summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js')
-rw-r--r--deps/npm/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/deps/npm/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js b/deps/npm/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js
deleted file mode 100644
index 07bf31d297..0000000000
--- a/deps/npm/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js
+++ /dev/null
@@ -1,51 +0,0 @@
-'use strict';
-module.exports = function generate_patternRequired(it, $keyword) {
- 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,
- $matched = 'patternMatched' + $lvl,
- $closingBraces = '',
- $ownProperties = it.opts.ownProperties;
- out += 'var ' + ($valid) + ' = true;';
- var arr1 = $schema;
- if (arr1) {
- var $pProperty, i1 = -1,
- l1 = arr1.length - 1;
- while (i1 < l1) {
- $pProperty = arr1[i1 += 1];
- out += ' var ' + ($matched) + ' = false; for (var ' + ($key) + ' in ' + ($data) + ') { ';
- if ($ownProperties) {
- out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; ';
- }
- 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;
-}