summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/ajv/lib/patternGroups.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/node_modules/ajv/lib/patternGroups.js')
-rw-r--r--tools/node_modules/eslint/node_modules/ajv/lib/patternGroups.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/patternGroups.js b/tools/node_modules/eslint/node_modules/ajv/lib/patternGroups.js
new file mode 100644
index 0000000000..531a8d004e
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/ajv/lib/patternGroups.js
@@ -0,0 +1,36 @@
+'use strict';
+
+var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema';
+
+module.exports = function (ajv) {
+ var defaultMeta = ajv._opts.defaultMeta;
+ var metaSchemaRef = typeof defaultMeta == 'string'
+ ? { $ref: defaultMeta }
+ : ajv.getSchema(META_SCHEMA_ID)
+ ? { $ref: META_SCHEMA_ID }
+ : {};
+
+ ajv.addKeyword('patternGroups', {
+ // implemented in properties.jst
+ metaSchema: {
+ type: 'object',
+ additionalProperties: {
+ type: 'object',
+ required: [ 'schema' ],
+ properties: {
+ maximum: {
+ type: 'integer',
+ minimum: 0
+ },
+ minimum: {
+ type: 'integer',
+ minimum: 0
+ },
+ schema: metaSchemaRef
+ },
+ additionalProperties: false
+ }
+ }
+ });
+ ajv.RULES.all.properties.implements.push('patternGroups');
+};