Skip to content

Commit 411884b

Browse files
committed
Emit enum integer values in TS code as a second enum
1 parent 38f5b96 commit 411884b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

types.go.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ export enum {{$type.Name}} {
1818
{{$field.Name}} = '{{$field.Name}}'
1919
{{- end}}
2020
}
21+
22+
export enum {{$type.Name}}Value {
23+
{{- range $i, $field := $type.Fields}}
24+
{{- if $i}},{{end}}
25+
{{$field.Name}} = {{$field.TypeExtra.Value}}
26+
{{- end}}
27+
}
2128
{{end -}}
2229

2330
{{- if isStructType $type }}

0 commit comments

Comments
 (0)