summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/ajv-keywords/keywords/dot/patternRequired.jst
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/node_modules/ajv-keywords/keywords/dot/patternRequired.jst')
-rw-r--r--tools/node_modules/eslint/node_modules/ajv-keywords/keywords/dot/patternRequired.jst33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/ajv-keywords/keywords/dot/patternRequired.jst b/tools/node_modules/eslint/node_modules/ajv-keywords/keywords/dot/patternRequired.jst
new file mode 100644
index 0000000000..6f82f6265e
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/ajv-keywords/keywords/dot/patternRequired.jst
@@ -0,0 +1,33 @@
+{{# 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 }}