Skip to content

Commit e046255

Browse files
committed
chore: update
1 parent e609a3c commit e046255

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/fieldsConverter.ts

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

0 commit comments

Comments
 (0)