-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow generating an array with all enum values
Fixes #303
- Loading branch information
Luis Fernando Planella Gonzalez
committed
Nov 17, 2023
1 parent
f367cd5
commit 0e80a4c
Showing
7 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export enum {{typeName}} { | ||
{{#enumValues}} {{name}} = {{{value}}}{{^@last}}, | ||
export enum {{{typeName}}} { | ||
{{#enumValues}} {{{name}}} = {{{value}}}{{^@last}}, | ||
{{/@last}}{{/enumValues}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import { {{{typeName}}} } from './{{{fileName}}}'; | ||
|
||
/** | ||
* Each possible value of `{{{typeName}}}` | ||
*/ | ||
export const {{{enumArrayName}}}: {{{typeName}}}[] = [ | ||
{{#enumValues}} {{{value}}}{{^@last}}, | ||
{{/@last}}{{/enumValues}} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters