diff options
Diffstat (limited to 'node_modules/ajv-keywords/keywords/if.js')
-rw-r--r-- | node_modules/ajv-keywords/keywords/if.js | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/node_modules/ajv-keywords/keywords/if.js b/node_modules/ajv-keywords/keywords/if.js deleted file mode 100644 index 8a8fc95ee..000000000 --- a/node_modules/ajv-keywords/keywords/if.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -module.exports = function defFunc(ajv) { - if (!ajv.RULES.keywords.switch) require('./switch')(ajv); - - defFunc.definition = { - macro: function (schema, parentSchema) { - if (parentSchema.then === undefined) - throw new Error('keyword "then" is absent'); - var cases = [ { 'if': schema, 'then': parentSchema.then } ]; - if (parentSchema.else !== undefined) - cases[1] = { 'then': parentSchema.else }; - return { switch: cases }; - } - }; - - ajv.addKeyword('if', defFunc.definition); - ajv.addKeyword('then'); - ajv.addKeyword('else'); - return ajv; -}; |