@hyperjump/json-schema
Advanced tools
Comparing version 0.17.0 to 0.17.1
@@ -28,3 +28,3 @@ const { Core, Schema, Instance } = require("@hyperjump/json-schema-core"); | ||
const collectEvaluatedItems = (keywordValue, instance, ast, dynamicAnchors) => { | ||
return interpret(keywordValue) && Instance.reduce((matchedIndexes, item, itemIndex) => { | ||
return interpret(keywordValue, instance, ast, dynamicAnchors) && Instance.reduce((matchedIndexes, item, itemIndex) => { | ||
return Core.interpretSchema(keywordValue.contains, item, ast, dynamicAnchors) ? matchedIndexes.add(itemIndex) : matchedIndexes; | ||
@@ -31,0 +31,0 @@ }, new Set(), instance); |
@@ -28,3 +28,3 @@ const { Core, Schema } = require("@hyperjump/json-schema-core"); | ||
const collectEvaluatedProperties = ([guard, block], instance, ast, dynamicAnchors) => { | ||
if (guard === undefined || Core.collectEvaluatedProperties(guard, instance, ast, dynamicAnchors) !== false) { | ||
if (guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors)) { | ||
return []; | ||
@@ -37,3 +37,3 @@ } | ||
const collectEvaluatedItems = ([guard, block], instance, ast, dynamicAnchors) => { | ||
if (guard === undefined || Core.collectEvaluatedItems(guard, instance, ast, dynamicAnchors) !== false) { | ||
if (guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors)) { | ||
return new Set(); | ||
@@ -40,0 +40,0 @@ } |
@@ -11,2 +11,10 @@ const { Core } = require("@hyperjump/json-schema-core"); | ||
module.exports = { compile, interpret }; | ||
const collectEvaluatedProperties = (ifSchema, instance, ast, dynamicAnchors) => { | ||
return Core.collectEvaluatedProperties(ifSchema, instance, ast, dynamicAnchors) || []; | ||
}; | ||
const collectEvaluatedItems = (ifSchema, instance, ast, dynamicAnchors) => { | ||
return Core.collectEvaluatedItems(ifSchema, instance, ast, dynamicAnchors) || new Set(); | ||
}; | ||
module.exports = { compile, interpret, collectEvaluatedProperties, collectEvaluatedItems }; |
@@ -28,29 +28,17 @@ const { Core, Schema } = require("@hyperjump/json-schema-core"); | ||
const collectEvaluatedProperties = ([guard, block], instance, ast, dynamicAnchors) => { | ||
if (guard === undefined) { | ||
if (guard === undefined || !quietInterpretSchema(guard, instance, ast, dynamicAnchors)) { | ||
return []; | ||
} | ||
const guardPropertyNames = Core.collectEvaluatedProperties(guard, instance, ast, dynamicAnchors); | ||
if (guardPropertyNames === false) { | ||
return []; | ||
} | ||
const blockPropertyNames = Core.collectEvaluatedProperties(block, instance, ast, dynamicAnchors); | ||
return blockPropertyNames !== false && [...guardPropertyNames, ...blockPropertyNames]; | ||
return Core.collectEvaluatedProperties(block, instance, ast, dynamicAnchors); | ||
}; | ||
const collectEvaluatedItems = ([guard, block], instance, ast, dynamicAnchors) => { | ||
if (guard === undefined) { | ||
if (guard === undefined || !quietInterpretSchema(guard, instance, ast, dynamicAnchors)) { | ||
return new Set(); | ||
} | ||
const guardItemIndexes = Core.collectEvaluatedItems(guard, instance, ast, dynamicAnchors); | ||
if (guardItemIndexes === false) { | ||
return new Set(); | ||
} | ||
const blockItemIndexes = Core.collectEvaluatedItems(block, instance, ast, dynamicAnchors); | ||
return blockItemIndexes !== false && new Set([...guardItemIndexes, ...blockItemIndexes]); | ||
return Core.collectEvaluatedItems(block, instance, ast, dynamicAnchors); | ||
}; | ||
module.exports = { compile, interpret, collectEvaluatedProperties, collectEvaluatedItems }; |
{ | ||
"name": "@hyperjump/json-schema", | ||
"version": "0.17.0", | ||
"version": "0.17.1", | ||
"description": "A JSON Schema Validator", | ||
@@ -36,6 +36,6 @@ "main": "lib/index.js", | ||
"eslint-import-resolver-node": "^0.3.4", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-import": "^2.23.4", | ||
"json-schema-test-suite": "github:json-schema-org/JSON-Schema-Test-Suite", | ||
"mocha": "^8.2.1", | ||
"rollup": "^2.34.1", | ||
"mocha": "^8.4.0", | ||
"rollup": "^2.50.5", | ||
"rollup-plugin-terser": "^5.3.1" | ||
@@ -42,0 +42,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4474872
27704