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/jtd/nullable.ts | |
parent | 7d3640f824f46490b47bd95f1c5a16644f712068 (diff) |
Izbrisala bin, obj i node-modules.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/jtd/nullable.ts')
-rw-r--r-- | sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/jtd/nullable.ts | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/jtd/nullable.ts b/sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/jtd/nullable.ts deleted file mode 100644 index c74b05da..00000000 --- a/sandbox/testAppNevena/Front/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type {KeywordCxt} from "../../compile/validate" -import {_, not, nil, Code, Name} from "../../compile/codegen" - -export function checkNullable( - {gen, data, parentSchema}: KeywordCxt, - cond: Code = nil -): [Name, Code] { - const valid = gen.name("valid") - if (parentSchema.nullable) { - gen.let(valid, _`${data} === null`) - cond = not(valid) - } else { - gen.let(valid, false) - } - return [valid, cond] -} - -export function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code] { - const [valid, cond_] = checkNullable(cxt, cond) - return [valid, _`${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`] -} |