massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / node_modules / ajv / lib / vocabularies / validation / pattern.ts
index 880279f8ff53600553860c8c212b8f0158c4e6e7..7b27b7d3c0dfafad85d8612a19ab1e46e899ec2c 100644 (file)
@@ -17,8 +17,10 @@ const def: CodeKeywordDefinition = {
   $data: true,
   error,
   code(cxt: KeywordCxt) {
-    const {gen, data, $data, schema, schemaCode} = cxt
-    const regExp = $data ? _`(new RegExp(${schemaCode}, "u"))` : usePattern(gen, schema) // TODO regexp should be wrapped in try/catch
+    const {data, $data, schema, schemaCode, it} = cxt
+    // TODO regexp should be wrapped in try/catchs
+    const u = it.opts.unicodeRegExp ? "u" : ""
+    const regExp = $data ? _`(new RegExp(${schemaCode}, ${u}))` : usePattern(cxt, schema)
     cxt.fail$data(_`!${regExp}.test(${data})`)
   },
 }