diff options
author | Nevena Bojovic <nenabojov@gmail.com> | 2022-03-01 22:05:25 +0100 |
---|---|---|
committer | Nevena Bojovic <nenabojov@gmail.com> | 2022-03-01 22:05:25 +0100 |
commit | 6555fb80fdd8f6a5d201efadec3189d1244830a0 (patch) | |
tree | c1aa1c5aedc634ad1ea7fad4847884d559b51290 /sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/validation/pattern.ts | |
parent | 7d3640f824f46490b47bd95f1c5a16644f712068 (diff) |
Izbrisala bin, obj i node-modules.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/validation/pattern.ts')
-rw-r--r-- | sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/validation/pattern.ts | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/validation/pattern.ts b/sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/validation/pattern.ts deleted file mode 100644 index 7b27b7d3..00000000 --- a/sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/validation/pattern.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {usePattern} from "../code" -import {_, str} from "../../compile/codegen" - -export type PatternError = ErrorObject<"pattern", {pattern: string}, string | {$data: string}> - -const error: KeywordErrorDefinition = { - message: ({schemaCode}) => str`must match pattern "${schemaCode}"`, - params: ({schemaCode}) => _`{pattern: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: true, - error, - code(cxt: KeywordCxt) { - 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})`) - }, -} - -export default def |