From 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Wed, 18 Nov 2020 23:26:45 +0100 Subject: rm node_modules --- node_modules/ajv-keywords/keywords/_formatLimit.js | 101 ------------ node_modules/ajv-keywords/keywords/_util.js | 15 -- node_modules/ajv-keywords/keywords/allRequired.js | 18 --- node_modules/ajv-keywords/keywords/anyRequired.js | 24 --- .../ajv-keywords/keywords/deepProperties.js | 54 ------- node_modules/ajv-keywords/keywords/deepRequired.js | 57 ------- .../ajv-keywords/keywords/dot/_formatLimit.jst | 116 -------------- .../ajv-keywords/keywords/dot/patternRequired.jst | 33 ---- node_modules/ajv-keywords/keywords/dot/switch.jst | 71 -------- node_modules/ajv-keywords/keywords/dotjs/README.md | 3 - .../ajv-keywords/keywords/dotjs/_formatLimit.js | 178 --------------------- .../ajv-keywords/keywords/dotjs/patternRequired.js | 58 ------- node_modules/ajv-keywords/keywords/dotjs/switch.js | 129 --------------- .../ajv-keywords/keywords/dynamicDefaults.js | 72 --------- .../ajv-keywords/keywords/formatMaximum.js | 3 - .../ajv-keywords/keywords/formatMinimum.js | 3 - node_modules/ajv-keywords/keywords/index.js | 22 --- node_modules/ajv-keywords/keywords/instanceof.js | 58 ------- node_modules/ajv-keywords/keywords/oneRequired.js | 24 --- .../ajv-keywords/keywords/patternRequired.js | 21 --- node_modules/ajv-keywords/keywords/prohibited.js | 24 --- node_modules/ajv-keywords/keywords/range.js | 36 ----- node_modules/ajv-keywords/keywords/regexp.js | 36 ----- node_modules/ajv-keywords/keywords/select.js | 79 --------- node_modules/ajv-keywords/keywords/switch.js | 38 ----- node_modules/ajv-keywords/keywords/transform.js | 80 --------- node_modules/ajv-keywords/keywords/typeof.js | 32 ---- .../ajv-keywords/keywords/uniqueItemProperties.js | 59 ------- 28 files changed, 1444 deletions(-) delete mode 100644 node_modules/ajv-keywords/keywords/_formatLimit.js delete mode 100644 node_modules/ajv-keywords/keywords/_util.js delete mode 100644 node_modules/ajv-keywords/keywords/allRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/anyRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/deepProperties.js delete mode 100644 node_modules/ajv-keywords/keywords/deepRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/dot/_formatLimit.jst delete mode 100644 node_modules/ajv-keywords/keywords/dot/patternRequired.jst delete mode 100644 node_modules/ajv-keywords/keywords/dot/switch.jst delete mode 100644 node_modules/ajv-keywords/keywords/dotjs/README.md delete mode 100644 node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js delete mode 100644 node_modules/ajv-keywords/keywords/dotjs/patternRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/dotjs/switch.js delete mode 100644 node_modules/ajv-keywords/keywords/dynamicDefaults.js delete mode 100644 node_modules/ajv-keywords/keywords/formatMaximum.js delete mode 100644 node_modules/ajv-keywords/keywords/formatMinimum.js delete mode 100644 node_modules/ajv-keywords/keywords/index.js delete mode 100644 node_modules/ajv-keywords/keywords/instanceof.js delete mode 100644 node_modules/ajv-keywords/keywords/oneRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/patternRequired.js delete mode 100644 node_modules/ajv-keywords/keywords/prohibited.js delete mode 100644 node_modules/ajv-keywords/keywords/range.js delete mode 100644 node_modules/ajv-keywords/keywords/regexp.js delete mode 100644 node_modules/ajv-keywords/keywords/select.js delete mode 100644 node_modules/ajv-keywords/keywords/switch.js delete mode 100644 node_modules/ajv-keywords/keywords/transform.js delete mode 100644 node_modules/ajv-keywords/keywords/typeof.js delete mode 100644 node_modules/ajv-keywords/keywords/uniqueItemProperties.js (limited to 'node_modules/ajv-keywords/keywords') diff --git a/node_modules/ajv-keywords/keywords/_formatLimit.js b/node_modules/ajv-keywords/keywords/_formatLimit.js deleted file mode 100644 index e731a8a..0000000 --- a/node_modules/ajv-keywords/keywords/_formatLimit.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i; -var DATE_TIME_SEPARATOR = /t|\s/i; - -var COMPARE_FORMATS = { - date: compareDate, - time: compareTime, - 'date-time': compareDateTime -}; - -var $dataMetaSchema = { - type: 'object', - required: [ '$data' ], - properties: { - $data: { - type: 'string', - anyOf: [ - { format: 'relative-json-pointer' }, - { format: 'json-pointer' } - ] - } - }, - additionalProperties: false -}; - -module.exports = function (minMax) { - var keyword = 'format' + minMax; - return function defFunc(ajv) { - defFunc.definition = { - type: 'string', - inline: require('./dotjs/_formatLimit'), - statements: true, - errors: 'full', - dependencies: ['format'], - metaSchema: { - anyOf: [ - {type: 'string'}, - $dataMetaSchema - ] - } - }; - - ajv.addKeyword(keyword, defFunc.definition); - ajv.addKeyword('formatExclusive' + minMax, { - dependencies: ['format' + minMax], - metaSchema: { - anyOf: [ - {type: 'boolean'}, - $dataMetaSchema - ] - } - }); - extendFormats(ajv); - return ajv; - }; -}; - - -function extendFormats(ajv) { - var formats = ajv._formats; - for (var name in COMPARE_FORMATS) { - var format = formats[name]; - // the last condition is needed if it's RegExp from another window - if (typeof format != 'object' || format instanceof RegExp || !format.validate) - format = formats[name] = { validate: format }; - if (!format.compare) - format.compare = COMPARE_FORMATS[name]; - } -} - - -function compareDate(d1, d2) { - if (!(d1 && d2)) return; - if (d1 > d2) return 1; - if (d1 < d2) return -1; - if (d1 === d2) return 0; -} - - -function compareTime(t1, t2) { - if (!(t1 && t2)) return; - t1 = t1.match(TIME); - t2 = t2.match(TIME); - if (!(t1 && t2)) return; - t1 = t1[1] + t1[2] + t1[3] + (t1[4]||''); - t2 = t2[1] + t2[2] + t2[3] + (t2[4]||''); - if (t1 > t2) return 1; - if (t1 < t2) return -1; - if (t1 === t2) return 0; -} - - -function compareDateTime(dt1, dt2) { - if (!(dt1 && dt2)) return; - dt1 = dt1.split(DATE_TIME_SEPARATOR); - dt2 = dt2.split(DATE_TIME_SEPARATOR); - var res = compareDate(dt1[0], dt2[0]); - if (res === undefined) return; - return res || compareTime(dt1[1], dt2[1]); -} diff --git a/node_modules/ajv-keywords/keywords/_util.js b/node_modules/ajv-keywords/keywords/_util.js deleted file mode 100644 index dd52df7..0000000 --- a/node_modules/ajv-keywords/keywords/_util.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -module.exports = { - metaSchemaRef: metaSchemaRef -}; - -var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; - -function metaSchemaRef(ajv) { - var defaultMeta = ajv._opts.defaultMeta; - if (typeof defaultMeta == 'string') return { $ref: defaultMeta }; - if (ajv.getSchema(META_SCHEMA_ID)) return { $ref: META_SCHEMA_ID }; - console.warn('meta schema not defined'); - return {}; -} diff --git a/node_modules/ajv-keywords/keywords/allRequired.js b/node_modules/ajv-keywords/keywords/allRequired.js deleted file mode 100644 index afc73eb..0000000 --- a/node_modules/ajv-keywords/keywords/allRequired.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - type: 'object', - macro: function (schema, parentSchema) { - if (!schema) return true; - var properties = Object.keys(parentSchema.properties); - if (properties.length == 0) return true; - return {required: properties}; - }, - metaSchema: {type: 'boolean'}, - dependencies: ['properties'] - }; - - ajv.addKeyword('allRequired', defFunc.definition); - return ajv; -}; diff --git a/node_modules/ajv-keywords/keywords/anyRequired.js b/node_modules/ajv-keywords/keywords/anyRequired.js deleted file mode 100644 index acc55a9..0000000 --- a/node_modules/ajv-keywords/keywords/anyRequired.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - type: 'object', - macro: function (schema) { - if (schema.length == 0) return true; - if (schema.length == 1) return {required: schema}; - var schemas = schema.map(function (prop) { - return {required: [prop]}; - }); - return {anyOf: schemas}; - }, - metaSchema: { - type: 'array', - items: { - type: 'string' - } - } - }; - - ajv.addKeyword('anyRequired', defFunc.definition); - return ajv; -}; diff --git a/node_modules/ajv-keywords/keywords/deepProperties.js b/node_modules/ajv-keywords/keywords/deepProperties.js deleted file mode 100644 index e5aff60..0000000 --- a/node_modules/ajv-keywords/keywords/deepProperties.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -var util = require('./_util'); - -module.exports = function defFunc(ajv) { - defFunc.definition = { - type: 'object', - macro: function (schema) { - var schemas = []; - for (var pointer in schema) - schemas.push(getSchema(pointer, schema[pointer])); - return {'allOf': schemas}; - }, - metaSchema: { - type: 'object', - propertyNames: { - type: 'string', - format: 'json-pointer' - }, - additionalProperties: util.metaSchemaRef(ajv) - } - }; - - ajv.addKeyword('deepProperties', defFunc.definition); - return ajv; -}; - - -function getSchema(jsonPointer, schema) { - var segments = jsonPointer.split('/'); - var rootSchema = {}; - var pointerSchema = rootSchema; - for (var i=1; i' - , $result = 'result' + $lvl; -}} - -{{# def.$data }} - - -{{? $isDataExcl }} - {{ - var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) - , $exclusive = 'exclusive' + $lvl - , $opExpr = 'op' + $lvl - , $opStr = '\' + ' + $opExpr + ' + \''; - }} - var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; - {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} - - if (typeof {{=$schemaValueExcl}} != 'boolean' && {{=$schemaValueExcl}} !== undefined) { - {{=$valid}} = false; - {{ var $errorKeyword = $exclusiveKeyword; }} - {{# def.error:'_formatExclusiveLimit' }} - } - - {{# def.elseIfValid }} - - {{# def.compareFormat }} - var {{=$exclusive}} = {{=$schemaValueExcl}} === true; - - if ({{=$valid}} === undefined) { - {{=$valid}} = {{=$exclusive}} - ? {{=$result}} {{=$op}} 0 - : {{=$result}} {{=$op}}= 0; - } - - if (!{{=$valid}}) var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; -{{??}} - {{ - var $exclusive = $schemaExcl === true - , $opStr = $op; /*used in error*/ - if (!$exclusive) $opStr += '='; - var $opExpr = '\'' + $opStr + '\''; /*used in error*/ - }} - - {{# def.compareFormat }} - - if ({{=$valid}} === undefined) - {{=$valid}} = {{=$result}} {{=$op}}{{?!$exclusive}}={{?}} 0; -{{?}} - -{{= $closingBraces }} - -if (!{{=$valid}}) { - {{ var $errorKeyword = $keyword; }} - {{# def.error:'_formatLimit' }} -} diff --git a/node_modules/ajv-keywords/keywords/dot/patternRequired.jst b/node_modules/ajv-keywords/keywords/dot/patternRequired.jst deleted file mode 100644 index 6f82f62..0000000 --- a/node_modules/ajv-keywords/keywords/dot/patternRequired.jst +++ /dev/null @@ -1,33 +0,0 @@ -{{# def.definitions }} -{{# def.errors }} -{{# def.setupKeyword }} - -{{ - var $key = 'key' + $lvl - , $idx = 'idx' + $lvl - , $matched = 'patternMatched' + $lvl - , $dataProperties = 'dataProperties' + $lvl - , $closingBraces = '' - , $ownProperties = it.opts.ownProperties; -}} - -var {{=$valid}} = true; -{{? $ownProperties }} - var {{=$dataProperties}} = undefined; -{{?}} - -{{~ $schema:$pProperty }} - var {{=$matched}} = false; - {{# def.iterateProperties }} - {{=$matched}} = {{= it.usePattern($pProperty) }}.test({{=$key}}); - if ({{=$matched}}) break; - } - - {{ var $missingPattern = it.util.escapeQuotes($pProperty); }} - if (!{{=$matched}}) { - {{=$valid}} = false; - {{# def.addError:'patternRequired' }} - } {{# def.elseIfValid }} -{{~}} - -{{= $closingBraces }} diff --git a/node_modules/ajv-keywords/keywords/dot/switch.jst b/node_modules/ajv-keywords/keywords/dot/switch.jst deleted file mode 100644 index 24d68cf..0000000 --- a/node_modules/ajv-keywords/keywords/dot/switch.jst +++ /dev/null @@ -1,71 +0,0 @@ -{{# def.definitions }} -{{# def.errors }} -{{# def.setupKeyword }} -{{# def.setupNextLevel }} - - -{{## def.validateIf: - {{# def.setCompositeRule }} - {{ $it.createErrors = false; }} - {{# def._validateSwitchRule:if }} - {{ $it.createErrors = true; }} - {{# def.resetCompositeRule }} - {{=$ifPassed}} = {{=$nextValid}}; -#}} - -{{## def.validateThen: - {{? typeof $sch.then == 'boolean' }} - {{? $sch.then === false }} - {{# def.error:'switch' }} - {{?}} - var {{=$nextValid}} = {{= $sch.then }}; - {{??}} - {{# def._validateSwitchRule:then }} - {{?}} -#}} - -{{## def._validateSwitchRule:_clause: - {{ - $it.schema = $sch._clause; - $it.schemaPath = $schemaPath + '[' + $caseIndex + ']._clause'; - $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/_clause'; - }} - {{# def.insertSubschemaCode }} -#}} - -{{## def.switchCase: - {{? $sch.if && {{# def.nonEmptySchema:$sch.if }} }} - var {{=$errs}} = errors; - {{# def.validateIf }} - if ({{=$ifPassed}}) { - {{# def.validateThen }} - } else { - {{# def.resetErrors }} - } - {{??}} - {{=$ifPassed}} = true; - {{# def.validateThen }} - {{?}} -#}} - - -{{ - var $ifPassed = 'ifPassed' + it.level - , $currentBaseId = $it.baseId - , $shouldContinue; -}} -var {{=$ifPassed}}; - -{{~ $schema:$sch:$caseIndex }} - {{? $caseIndex && !$shouldContinue }} - if (!{{=$ifPassed}}) { - {{ $closingBraces+= '}'; }} - {{?}} - - {{# def.switchCase }} - {{ $shouldContinue = $sch.continue }} -{{~}} - -{{= $closingBraces }} - -var {{=$valid}} = {{=$nextValid}}; diff --git a/node_modules/ajv-keywords/keywords/dotjs/README.md b/node_modules/ajv-keywords/keywords/dotjs/README.md deleted file mode 100644 index e2846c8..0000000 --- a/node_modules/ajv-keywords/keywords/dotjs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -These files are compiled dot templates from dot folder. - -Do NOT edit them directly, edit the templates and run `npm run build` from main ajv-keywords folder. diff --git a/node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js b/node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js deleted file mode 100644 index d2af638..0000000 --- a/node_modules/ajv-keywords/keywords/dotjs/_formatLimit.js +++ /dev/null @@ -1,178 +0,0 @@ -'use strict'; -module.exports = function generate__formatLimit(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - out += 'var ' + ($valid) + ' = undefined;'; - if (it.opts.format === false) { - out += ' ' + ($valid) + ' = true; '; - return out; - } - var $schemaFormat = it.schema.format, - $isDataFormat = it.opts.$data && $schemaFormat.$data, - $closingBraces = ''; - if ($isDataFormat) { - var $schemaValueFormat = it.util.getData($schemaFormat.$data, $dataLvl, it.dataPathArr), - $format = 'format' + $lvl, - $compare = 'compare' + $lvl; - out += ' var ' + ($format) + ' = formats[' + ($schemaValueFormat) + '] , ' + ($compare) + ' = ' + ($format) + ' && ' + ($format) + '.compare;'; - } else { - var $format = it.formats[$schemaFormat]; - if (!($format && $format.compare)) { - out += ' ' + ($valid) + ' = true; '; - return out; - } - var $compare = 'formats' + it.util.getProperty($schemaFormat) + '.compare'; - } - var $isMax = $keyword == 'formatMaximum', - $exclusiveKeyword = 'formatExclusive' + ($isMax ? 'Maximum' : 'Minimum'), - $schemaExcl = it.schema[$exclusiveKeyword], - $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, - $op = $isMax ? '<' : '>', - $result = 'result' + $lvl; - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - if ($isDataExcl) { - var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), - $exclusive = 'exclusive' + $lvl, - $opExpr = 'op' + $lvl, - $opStr = '\' + ' + $opExpr + ' + \''; - out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; - $schemaValueExcl = 'schemaExcl' + $lvl; - out += ' if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && ' + ($schemaValueExcl) + ' !== undefined) { ' + ($valid) + ' = false; '; - var $errorKeyword = $exclusiveKeyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_formatExclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { - /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($breakOnError) { - $closingBraces += '}'; - out += ' else { '; - } - if ($isData) { - out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; - $closingBraces += '}'; - } - if ($isDataFormat) { - out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; - $closingBraces += '}'; - } - out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; var ' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true; if (' + ($valid) + ' === undefined) { ' + ($valid) + ' = ' + ($exclusive) + ' ? ' + ($result) + ' ' + ($op) + ' 0 : ' + ($result) + ' ' + ($op) + '= 0; } if (!' + ($valid) + ') var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; - } else { - var $exclusive = $schemaExcl === true, - $opStr = $op; - if (!$exclusive) $opStr += '='; - var $opExpr = '\'' + $opStr + '\''; - if ($isData) { - out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; - $closingBraces += '}'; - } - if ($isDataFormat) { - out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; - $closingBraces += '}'; - } - out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; if (' + ($valid) + ' === undefined) ' + ($valid) + ' = ' + ($result) + ' ' + ($op); - if (!$exclusive) { - out += '='; - } - out += ' 0;'; - } - out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; - var $errorKeyword = $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_formatLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' , exclusive: ' + ($exclusive) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be ' + ($opStr) + ' "'; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + (it.util.escapeQuotes($schema)); - } - out += '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { - /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '}'; - return out; -} diff --git a/node_modules/ajv-keywords/keywords/dotjs/patternRequired.js b/node_modules/ajv-keywords/keywords/dotjs/patternRequired.js deleted file mode 100644 index 31bd0b6..0000000 --- a/node_modules/ajv-keywords/keywords/dotjs/patternRequired.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; -module.exports = function generate_patternRequired(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $key = 'key' + $lvl, - $idx = 'idx' + $lvl, - $matched = 'patternMatched' + $lvl, - $dataProperties = 'dataProperties' + $lvl, - $closingBraces = '', - $ownProperties = it.opts.ownProperties; - out += 'var ' + ($valid) + ' = true;'; - if ($ownProperties) { - out += ' var ' + ($dataProperties) + ' = undefined;'; - } - var arr1 = $schema; - if (arr1) { - var $pProperty, i1 = -1, - l1 = arr1.length - 1; - while (i1 < l1) { - $pProperty = arr1[i1 += 1]; - out += ' var ' + ($matched) + ' = false; '; - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - out += ' ' + ($matched) + ' = ' + (it.usePattern($pProperty)) + '.test(' + ($key) + '); if (' + ($matched) + ') break; } '; - var $missingPattern = it.util.escapeQuotes($pProperty); - out += ' if (!' + ($matched) + ') { ' + ($valid) + ' = false; var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternRequired') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingPattern: \'' + ($missingPattern) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should have property matching pattern \\\'' + ($missingPattern) + '\\\'\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; - if ($breakOnError) { - $closingBraces += '}'; - out += ' else { '; - } - } - } - out += '' + ($closingBraces); - return out; -} diff --git a/node_modules/ajv-keywords/keywords/dotjs/switch.js b/node_modules/ajv-keywords/keywords/dotjs/switch.js deleted file mode 100644 index 0a3fb80..0000000 --- a/node_modules/ajv-keywords/keywords/dotjs/switch.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; -module.exports = function generate_switch(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $ifPassed = 'ifPassed' + it.level, - $currentBaseId = $it.baseId, - $shouldContinue; - out += 'var ' + ($ifPassed) + ';'; - var arr1 = $schema; - if (arr1) { - var $sch, $caseIndex = -1, - l1 = arr1.length - 1; - while ($caseIndex < l1) { - $sch = arr1[$caseIndex += 1]; - if ($caseIndex && !$shouldContinue) { - out += ' if (!' + ($ifPassed) + ') { '; - $closingBraces += '}'; - } - if ($sch.if && (it.opts.strictKeywords ? typeof $sch.if == 'object' && Object.keys($sch.if).length > 0 : it.util.schemaHasRules($sch.if, it.RULES.all))) { - out += ' var ' + ($errs) + ' = errors; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.createErrors = false; - $it.schema = $sch.if; - $it.schemaPath = $schemaPath + '[' + $caseIndex + '].if'; - $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/if'; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - $it.createErrors = true; - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' ' + ($ifPassed) + ' = ' + ($nextValid) + '; if (' + ($ifPassed) + ') { '; - if (typeof $sch.then == 'boolean') { - if ($sch.then === false) { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should pass "switch" keyword validation\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { - /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - } - out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; - } else { - $it.schema = $sch.then; - $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; - $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - } - out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } } '; - } else { - out += ' ' + ($ifPassed) + ' = true; '; - if (typeof $sch.then == 'boolean') { - if ($sch.then === false) { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should pass "switch" keyword validation\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { - /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - } - out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; - } else { - $it.schema = $sch.then; - $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; - $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - } - } - $shouldContinue = $sch.continue - } - } - out += '' + ($closingBraces) + 'var ' + ($valid) + ' = ' + ($nextValid) + ';'; - return out; -} diff --git a/node_modules/ajv-keywords/keywords/dynamicDefaults.js b/node_modules/ajv-keywords/keywords/dynamicDefaults.js deleted file mode 100644 index 5323bb8..0000000 --- a/node_modules/ajv-keywords/keywords/dynamicDefaults.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -var sequences = {}; - -var DEFAULTS = { - timestamp: function() { return Date.now(); }, - datetime: function() { return (new Date).toISOString(); }, - date: function() { return (new Date).toISOString().slice(0, 10); }, - time: function() { return (new Date).toISOString().slice(11); }, - random: function() { return Math.random(); }, - randomint: function (args) { - var limit = args && args.max || 2; - return function() { return Math.floor(Math.random() * limit); }; - }, - seq: function (args) { - var name = args && args.name || ''; - sequences[name] = sequences[name] || 0; - return function() { return sequences[name]++; }; - } -}; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - compile: function (schema, parentSchema, it) { - var funcs = {}; - - for (var key in schema) { - var d = schema[key]; - var func = getDefault(typeof d == 'string' ? d : d.func); - funcs[key] = func.length ? func(d.args) : func; - } - - return it.opts.useDefaults && !it.compositeRule - ? assignDefaults - : noop; - - function assignDefaults(data) { - for (var prop in schema){ - if (data[prop] === undefined - || (it.opts.useDefaults == 'empty' - && (data[prop] === null || data[prop] === ''))) - data[prop] = funcs[prop](); - } - return true; - } - - function noop() { return true; } - }, - DEFAULTS: DEFAULTS, - metaSchema: { - type: 'object', - additionalProperties: { - type: ['string', 'object'], - additionalProperties: false, - required: ['func', 'args'], - properties: { - func: { type: 'string' }, - args: { type: 'object' } - } - } - } - }; - - ajv.addKeyword('dynamicDefaults', defFunc.definition); - return ajv; - - function getDefault(d) { - var def = DEFAULTS[d]; - if (def) return def; - throw new Error('invalid "dynamicDefaults" keyword property value: ' + d); - } -}; diff --git a/node_modules/ajv-keywords/keywords/formatMaximum.js b/node_modules/ajv-keywords/keywords/formatMaximum.js deleted file mode 100644 index e7daabf..0000000 --- a/node_modules/ajv-keywords/keywords/formatMaximum.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./_formatLimit')('Maximum'); diff --git a/node_modules/ajv-keywords/keywords/formatMinimum.js b/node_modules/ajv-keywords/keywords/formatMinimum.js deleted file mode 100644 index eddd6e4..0000000 --- a/node_modules/ajv-keywords/keywords/formatMinimum.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./_formatLimit')('Minimum'); diff --git a/node_modules/ajv-keywords/keywords/index.js b/node_modules/ajv-keywords/keywords/index.js deleted file mode 100644 index 99534ec..0000000 --- a/node_modules/ajv-keywords/keywords/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -module.exports = { - 'instanceof': require('./instanceof'), - range: require('./range'), - regexp: require('./regexp'), - 'typeof': require('./typeof'), - dynamicDefaults: require('./dynamicDefaults'), - allRequired: require('./allRequired'), - anyRequired: require('./anyRequired'), - oneRequired: require('./oneRequired'), - prohibited: require('./prohibited'), - uniqueItemProperties: require('./uniqueItemProperties'), - deepProperties: require('./deepProperties'), - deepRequired: require('./deepRequired'), - formatMinimum: require('./formatMinimum'), - formatMaximum: require('./formatMaximum'), - patternRequired: require('./patternRequired'), - 'switch': require('./switch'), - select: require('./select'), - transform: require('./transform') -}; diff --git a/node_modules/ajv-keywords/keywords/instanceof.js b/node_modules/ajv-keywords/keywords/instanceof.js deleted file mode 100644 index ea88f5c..0000000 --- a/node_modules/ajv-keywords/keywords/instanceof.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -var CONSTRUCTORS = { - Object: Object, - Array: Array, - Function: Function, - Number: Number, - String: String, - Date: Date, - RegExp: RegExp -}; - -module.exports = function defFunc(ajv) { - /* istanbul ignore else */ - if (typeof Buffer != 'undefined') - CONSTRUCTORS.Buffer = Buffer; - - /* istanbul ignore else */ - if (typeof Promise != 'undefined') - CONSTRUCTORS.Promise = Promise; - - defFunc.definition = { - compile: function (schema) { - if (typeof schema == 'string') { - var Constructor = getConstructor(schema); - return function (data) { - return data instanceof Constructor; - }; - } - - var constructors = schema.map(getConstructor); - return function (data) { - for (var i=0; i max || (exclusive && min == max)) - throw new Error('There are no numbers in range'); - } -}; diff --git a/node_modules/ajv-keywords/keywords/regexp.js b/node_modules/ajv-keywords/keywords/regexp.js deleted file mode 100644 index 973628c..0000000 --- a/node_modules/ajv-keywords/keywords/regexp.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - type: 'string', - inline: function (it, keyword, schema) { - return getRegExp() + '.test(data' + (it.dataLevel || '') + ')'; - - function getRegExp() { - try { - if (typeof schema == 'object') - return new RegExp(schema.pattern, schema.flags); - - var rx = schema.match(/^\/(.*)\/([gimuy]*)$/); - if (rx) return new RegExp(rx[1], rx[2]); - throw new Error('cannot parse string into RegExp'); - } catch(e) { - console.error('regular expression', schema, 'is invalid'); - throw e; - } - } - }, - metaSchema: { - type: ['string', 'object'], - properties: { - pattern: { type: 'string' }, - flags: { type: 'string' } - }, - required: ['pattern'], - additionalProperties: false - } - }; - - ajv.addKeyword('regexp', defFunc.definition); - return ajv; -}; diff --git a/node_modules/ajv-keywords/keywords/select.js b/node_modules/ajv-keywords/keywords/select.js deleted file mode 100644 index f79c6c7..0000000 --- a/node_modules/ajv-keywords/keywords/select.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -var util = require('./_util'); - -module.exports = function defFunc(ajv) { - if (!ajv._opts.$data) { - console.warn('keyword select requires $data option'); - return ajv; - } - var metaSchemaRef = util.metaSchemaRef(ajv); - var compiledCaseSchemas = []; - - defFunc.definition = { - validate: function v(schema, data, parentSchema) { - if (parentSchema.selectCases === undefined) - throw new Error('keyword "selectCases" is absent'); - var compiled = getCompiledSchemas(parentSchema, false); - var validate = compiled.cases[schema]; - if (validate === undefined) validate = compiled.default; - if (typeof validate == 'boolean') return validate; - var valid = validate(data); - if (!valid) v.errors = validate.errors; - return valid; - }, - $data: true, - metaSchema: { type: ['string', 'number', 'boolean', 'null'] } - }; - - ajv.addKeyword('select', defFunc.definition); - ajv.addKeyword('selectCases', { - compile: function (schemas, parentSchema) { - var compiled = getCompiledSchemas(parentSchema); - for (var value in schemas) - compiled.cases[value] = compileOrBoolean(schemas[value]); - return function() { return true; }; - }, - valid: true, - metaSchema: { - type: 'object', - additionalProperties: metaSchemaRef - } - }); - ajv.addKeyword('selectDefault', { - compile: function (schema, parentSchema) { - var compiled = getCompiledSchemas(parentSchema); - compiled.default = compileOrBoolean(schema); - return function() { return true; }; - }, - valid: true, - metaSchema: metaSchemaRef - }); - return ajv; - - - function getCompiledSchemas(parentSchema, create) { - var compiled; - compiledCaseSchemas.some(function (c) { - if (c.parentSchema === parentSchema) { - compiled = c; - return true; - } - }); - if (!compiled && create !== false) { - compiled = { - parentSchema: parentSchema, - cases: {}, - default: true - }; - compiledCaseSchemas.push(compiled); - } - return compiled; - } - - function compileOrBoolean(schema) { - return typeof schema == 'boolean' - ? schema - : ajv.compile(schema); - } -}; diff --git a/node_modules/ajv-keywords/keywords/switch.js b/node_modules/ajv-keywords/keywords/switch.js deleted file mode 100644 index 5b0f3f8..0000000 --- a/node_modules/ajv-keywords/keywords/switch.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -var util = require('./_util'); - -module.exports = function defFunc(ajv) { - if (ajv.RULES.keywords.switch && ajv.RULES.keywords.if) return; - - var metaSchemaRef = util.metaSchemaRef(ajv); - - defFunc.definition = { - inline: require('./dotjs/switch'), - statements: true, - errors: 'full', - metaSchema: { - type: 'array', - items: { - required: [ 'then' ], - properties: { - 'if': metaSchemaRef, - 'then': { - anyOf: [ - { type: 'boolean' }, - metaSchemaRef - ] - }, - 'continue': { type: 'boolean' } - }, - additionalProperties: false, - dependencies: { - 'continue': [ 'if' ] - } - } - } - }; - - ajv.addKeyword('switch', defFunc.definition); - return ajv; -}; diff --git a/node_modules/ajv-keywords/keywords/transform.js b/node_modules/ajv-keywords/keywords/transform.js deleted file mode 100644 index d715452..0000000 --- a/node_modules/ajv-keywords/keywords/transform.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -module.exports = function defFunc (ajv) { - var transform = { - trimLeft: function (value) { - return value.replace(/^[\s]+/, ''); - }, - trimRight: function (value) { - return value.replace(/[\s]+$/, ''); - }, - trim: function (value) { - return value.trim(); - }, - toLowerCase: function (value) { - return value.toLowerCase(); - }, - toUpperCase: function (value) { - return value.toUpperCase(); - }, - toEnumCase: function (value, cfg) { - return cfg.hash[makeHashTableKey(value)] || value; - } - }; - - defFunc.definition = { - type: 'string', - errors: false, - modifying: true, - valid: true, - compile: function (schema, parentSchema) { - var cfg; - - if (schema.indexOf('toEnumCase') !== -1) { - // build hash table to enum values - cfg = {hash: {}}; - - // requires `enum` in schema - if (!parentSchema.enum) - throw new Error('Missing enum. To use `transform:["toEnumCase"]`, `enum:[...]` is required.'); - for (var i = parentSchema.enum.length; i--; i) { - var v = parentSchema.enum[i]; - if (typeof v !== 'string') continue; - var k = makeHashTableKey(v); - // requires all `enum` values have unique keys - if (cfg.hash[k]) - throw new Error('Invalid enum uniqueness. To use `transform:["toEnumCase"]`, all values must be unique when case insensitive.'); - cfg.hash[k] = v; - } - } - - return function (data, dataPath, object, key) { - // skip if value only - if (!object) return; - - // apply transform in order provided - for (var j = 0, l = schema.length; j < l; j++) - data = transform[schema[j]](data, cfg); - - object[key] = data; - }; - }, - metaSchema: { - type: 'array', - items: { - type: 'string', - enum: [ - 'trimLeft', 'trimRight', 'trim', - 'toLowerCase', 'toUpperCase', 'toEnumCase' - ] - } - } - }; - - ajv.addKeyword('transform', defFunc.definition); - return ajv; - - function makeHashTableKey (value) { - return value.toLowerCase(); - } -}; diff --git a/node_modules/ajv-keywords/keywords/typeof.js b/node_modules/ajv-keywords/keywords/typeof.js deleted file mode 100644 index 3a3574d..0000000 --- a/node_modules/ajv-keywords/keywords/typeof.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -var KNOWN_TYPES = ['undefined', 'string', 'number', 'object', 'function', 'boolean', 'symbol']; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - inline: function (it, keyword, schema) { - var data = 'data' + (it.dataLevel || ''); - if (typeof schema == 'string') return 'typeof ' + data + ' == "' + schema + '"'; - schema = 'validate.schema' + it.schemaPath + '.' + keyword; - return schema + '.indexOf(typeof ' + data + ') >= 0'; - }, - metaSchema: { - anyOf: [ - { - type: 'string', - enum: KNOWN_TYPES - }, - { - type: 'array', - items: { - type: 'string', - enum: KNOWN_TYPES - } - } - ] - } - }; - - ajv.addKeyword('typeof', defFunc.definition); - return ajv; -}; diff --git a/node_modules/ajv-keywords/keywords/uniqueItemProperties.js b/node_modules/ajv-keywords/keywords/uniqueItemProperties.js deleted file mode 100644 index cd670da..0000000 --- a/node_modules/ajv-keywords/keywords/uniqueItemProperties.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -var SCALAR_TYPES = ['number', 'integer', 'string', 'boolean', 'null']; - -module.exports = function defFunc(ajv) { - defFunc.definition = { - type: 'array', - compile: function(keys, parentSchema, it) { - var equal = it.util.equal; - var scalar = getScalarKeys(keys, parentSchema); - - return function(data) { - if (data.length > 1) { - for (var k=0; k < keys.length; k++) { - var i, key = keys[k]; - if (scalar[k]) { - var hash = {}; - for (i = data.length; i--;) { - if (!data[i] || typeof data[i] != 'object') continue; - var prop = data[i][key]; - if (prop && typeof prop == 'object') continue; - if (typeof prop == 'string') prop = '"' + prop; - if (hash[prop]) return false; - hash[prop] = true; - } - } else { - for (i = data.length; i--;) { - if (!data[i] || typeof data[i] != 'object') continue; - for (var j = i; j--;) { - if (data[j] && typeof data[j] == 'object' && equal(data[i][key], data[j][key])) - return false; - } - } - } - } - } - return true; - }; - }, - metaSchema: { - type: 'array', - items: {type: 'string'} - } - }; - - ajv.addKeyword('uniqueItemProperties', defFunc.definition); - return ajv; -}; - - -function getScalarKeys(keys, schema) { - return keys.map(function(key) { - var properties = schema.items && schema.items.properties; - var propType = properties && properties[key] && properties[key].type; - return Array.isArray(propType) - ? propType.indexOf('object') < 0 && propType.indexOf('array') < 0 - : SCALAR_TYPES.indexOf(propType) >= 0; - }); -} -- cgit v1.2.3