File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
import type { Enum } from '../../../client/interfaces/Enum' ;
2
+ import { isString } from '../../../utils/isString' ;
2
3
import type { WithEnumExtension } from '../interfaces/Extensions/WithEnumExtension' ;
3
4
4
5
/**
@@ -7,9 +8,9 @@ import type { WithEnumExtension } from '../interfaces/Extensions/WithEnumExtensi
7
8
* @param enumerators
8
9
* @param definition
9
10
*/
10
- export function extendEnum ( enumerators : Enum [ ] , definition : WithEnumExtension ) : Enum [ ] {
11
- const names = definition [ 'x-enum-varnames' ] ;
12
- const descriptions = definition [ 'x-enum-descriptions' ] ;
11
+ export const extendEnum = ( enumerators : Enum [ ] , definition : WithEnumExtension ) : Enum [ ] => {
12
+ const names = definition [ 'x-enum-varnames' ] ?. filter ( isString ) ;
13
+ const descriptions = definition [ 'x-enum-descriptions' ] ?. filter ( isString ) ;
13
14
14
15
return enumerators . map ( ( enumerator , index ) => ( {
15
16
name : names ?. [ index ] || enumerator . name ,
You can’t perform that action at this time.
0 commit comments