Skip to content

Commit

Permalink
fix: 🩹 jsonKey use RegExp instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
KylianB authored and Morgbn committed Jun 4, 2024
1 parent f097d79 commit d34e9c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/typeGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type _ExclusiveUnion<T, K extends PropertyKey> =
type OneOf<T> = _ExclusiveUnion<T, _AllKeys<T>>`

const capFirst = (str: string) => str[0].toUpperCase() + str.slice(1)
const jsonKey = (str: string) => str.match('\\W') ? `'${str}'` : str
const jsonKey = (str: string) => str.match(/\W/g) ? `'${str}'` : str

const refRe = /(\w+)(?:\.\w+)?#(?:\/(\w+))+/
function simplestType (schema: Schema, interfaceName: string, stack: Stack): string {
Expand Down

0 comments on commit d34e9c7

Please sign in to comment.