@hyperjump/json-schema 0.23.3 → 0.23.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,16 @@ const interpret = ([numberOfItems, additionalItems], instance, ast, dynamicAncho
17
17
  };
18
18
 
19
19
  const collectEvaluatedItems = (keywordValue, instance, ast, dynamicAnchors) => {
20
- return interpret(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance.map((item, ndx) => ndx, instance));
20
+ if (!interpret(keywordValue, instance, ast, dynamicAnchors)) {
21
+ return false;
22
+ }
23
+
24
+ const evaluatedIndexes = new Set();
25
+ for (let ndx = keywordValue[0]; ndx < Instance.length(instance); ndx++) {
26
+ evaluatedIndexes.add(ndx);
27
+ }
28
+
29
+ return evaluatedIndexes;
21
30
  };
22
31
 
23
32
  module.exports = { compile, interpret, collectEvaluatedItems };
@@ -6,15 +6,14 @@ const compile = async (dynamicRef, ast) => {
6
6
  const [, fragment] = splitUrl(Schema.value(dynamicRef));
7
7
  const referencedSchema = await Schema.get(Schema.value(dynamicRef), dynamicRef);
8
8
  await Core.compileSchema(referencedSchema, ast);
9
- return [referencedSchema.id, fragment];
9
+ return [referencedSchema.id, fragment, Schema.uri(referencedSchema)];
10
10
  };
11
11
 
12
- const interpret = ([id, fragment], instance, ast, dynamicAnchors) => {
12
+ const interpret = ([id, fragment, ref], instance, ast, dynamicAnchors) => {
13
13
  if (fragment in ast.metaData[id].dynamicAnchors) {
14
14
  return Core.interpretSchema(dynamicAnchors[fragment], instance, ast, dynamicAnchors);
15
15
  } else {
16
- const pointer = Schema.getAnchorPointer(ast.metaData[id], fragment);
17
- return Core.interpretSchema(`${id}#${encodeURI(pointer)}`, instance, ast, dynamicAnchors);
16
+ return Core.interpretSchema(ref, instance, ast, dynamicAnchors);
18
17
  }
19
18
  };
20
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperjump/json-schema",
3
- "version": "0.23.3",
3
+ "version": "0.23.5",
4
4
  "description": "A JSON Schema Validator",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -13,7 +13,7 @@
13
13
  "test": "mocha --require ts-node/register 'lib/**/*.spec.ts'",
14
14
  "build": "rollup --config rollup.config.js",
15
15
  "prepublishOnly": "npm run build",
16
- "postinstall": "node -e \"require('fs').rmSync('dist', { recursive: true })\""
16
+ "postinstall": "node -e \"require('fs').rmSync('dist', { force: true, recursive: true })\""
17
17
  },
18
18
  "repository": "github:hyperjump-io/json-schema-validator",
19
19
  "keywords": [
@@ -35,6 +35,7 @@
35
35
  "devDependencies": {
36
36
  "@rollup/plugin-commonjs": "*",
37
37
  "@rollup/plugin-node-resolve": "*",
38
+ "@rollup/plugin-terser": "*",
38
39
  "@types/chai": "*",
39
40
  "@types/mocha": "*",
40
41
  "@typescript-eslint/eslint-plugin": "*",
@@ -48,12 +49,12 @@
48
49
  "mocha": "*",
49
50
  "rimraf": "*",
50
51
  "rollup": "*",
51
- "rollup-plugin-terser": "*",
52
52
  "ts-node": "*",
53
53
  "typescript": "*"
54
54
  },
55
55
  "dependencies": {
56
56
  "@hyperjump/json-schema-core": "^0.28.0",
57
- "fastest-stable-stringify": "^2.0.2"
57
+ "fastest-stable-stringify": "^2.0.2",
58
+ "just-curry-it": "^5.3.0"
58
59
  }
59
60
  }