Skip to content

Commit 875c849

Browse files
committed
chore: update
1 parent d6f6be5 commit 875c849

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/fieldsConverter.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,10 @@ export function enumToGraphQL(
395395
} else if (value === '') {
396396
key = 'EMPTY_STRING';
397397
} else {
398-
if (typeof value?.replace === 'function') {
399-
key = value?.replace(/[^_a-zA-Z0-9]/g, '_')?.replace(/(^[0-9])(.*)/g, 'a_$1$2');
400-
} else {
401-
key = value;
402-
}
398+
key = value
399+
?.toString()
400+
?.replace(/[^_a-zA-Z0-9]/g, '_')
401+
?.replace(/(^[0-9])(.*)/g, 'a_$1$2');
403402
}
404403
result[key] = { value };
405404
return result;

0 commit comments

Comments
 (0)