Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoniangreen committed Aug 7, 2024
1 parent 3380afd commit ae457fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/vocabularies/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ export function usePattern({gen, it: {opts, errSchemaPath}}: KeywordCxt, pattern

let rx: RegExpLike
try {
rx = new RegExp(pattern, u)
rx = regExp(pattern, u)
} catch (e) {
throw new Error(`${(e as Error).message} | pattern ${pattern} at ${errSchemaPath}`)
}
rx = regExp(pattern, u)

return gen.scopeValue("pattern", {
key: rx.toString(),
Expand Down

0 comments on commit ae457fb

Please sign in to comment.