@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.
@@ -45,7 +45,11 @@ function curry$b(fn, arity) {
45
45
  };
46
46
  }
47
47
 
48
- var pubsub = {exports: {}};
48
+ var pubsubExports = {};
49
+ var pubsub = {
50
+ get exports(){ return pubsubExports; },
51
+ set exports(v){ pubsubExports = v; },
52
+ };
49
53
 
50
54
  /**
51
55
  * Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk
@@ -399,9 +403,13 @@ var pubsub = {exports: {}};
399
403
  return result;
400
404
  };
401
405
  }));
402
- } (pubsub, pubsub.exports));
406
+ } (pubsub, pubsubExports));
403
407
 
404
- var uri_all = {exports: {}};
408
+ var uri_allExports = {};
409
+ var uri_all = {
410
+ get exports(){ return uri_allExports; },
411
+ set exports(v){ uri_allExports = v; },
412
+ };
405
413
 
406
414
  /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
407
415
 
@@ -1807,9 +1815,9 @@ var uri_all = {exports: {}};
1807
1815
 
1808
1816
  })));
1809
1817
 
1810
- } (uri_all, uri_all.exports));
1818
+ } (uri_all, uri_allExports));
1811
1819
 
1812
- const URI = uri_all.exports;
1820
+ const URI = uri_allExports;
1813
1821
 
1814
1822
 
1815
1823
  const isObject$1 = (value) => typeof value === "object" && !Array.isArray(value) && value !== null;
@@ -1905,116 +1913,138 @@ const curry$a = justCurryIt$1;
1905
1913
 
1906
1914
  const nil$2 = "";
1907
1915
 
1908
- const compile$N = (pointer) => {
1916
+ const EXISTS = Symbol("EXISTS");
1917
+
1918
+ const segmentGenerator = (pointer) => {
1909
1919
  if (pointer.length > 0 && pointer[0] !== "/") {
1910
1920
  throw Error("Invalid JSON Pointer");
1911
1921
  }
1912
1922
 
1913
- return pointer.split("/").slice(1).map(unescape);
1914
- };
1923
+ let segmentStart = 1;
1924
+ let segmentEnd = 0;
1915
1925
 
1916
- const get$2 = (pointer, value = undefined) => {
1917
- const ptr = compile$N(pointer);
1926
+ return (mode) => {
1927
+ if (mode === EXISTS) {
1928
+ return segmentEnd < pointer.length;
1929
+ }
1930
+
1931
+ if (segmentEnd >= pointer.length) {
1932
+ return;
1933
+ }
1918
1934
 
1919
- const fn = (value) => ptr.reduce(([value, pointer], segment) => {
1920
- return [applySegment(value, segment, pointer), append(segment, pointer)];
1921
- }, [value, ""])[0];
1935
+ const position = pointer.indexOf("/", segmentStart);
1936
+ segmentEnd = position === -1 ? pointer.length : position;
1937
+ const segment = unescape(pointer.slice(segmentStart, segmentEnd));
1938
+ segmentStart = segmentEnd + 1;
1939
+
1940
+ return segment;
1941
+ };
1942
+ };
1943
+
1944
+ const get$2 = (pointer, subject = undefined) => {
1945
+ const nextSegment = segmentGenerator(pointer);
1946
+ const fn = (subject) => _get(nextSegment, subject, nil$2);
1947
+ return subject === undefined ? fn : fn(subject);
1948
+ };
1922
1949
 
1923
- return value === undefined ? fn : fn(value);
1950
+ const _get = (nextSegment, subject, cursor) => {
1951
+ if (!nextSegment(EXISTS)) {
1952
+ return subject;
1953
+ } else {
1954
+ const segment = nextSegment();
1955
+ return _get(nextSegment, applySegment(subject, segment, cursor), append(segment, cursor));
1956
+ }
1924
1957
  };
1925
1958
 
1926
1959
  const set = (pointer, subject = undefined, value = undefined) => {
1927
- const ptr = compile$N(pointer);
1928
- const fn = curry$a((subject, value) => _set(ptr, subject, value, nil$2));
1960
+ const nextSegment = segmentGenerator(pointer);
1961
+ const fn = curry$a((subject, value) => _set(nextSegment, subject, value, nil$2));
1929
1962
  return subject === undefined ? fn : fn(subject, value);
1930
1963
  };
1931
1964
 
1932
- const _set = (pointer, subject, value, cursor) => {
1933
- if (pointer.length === 0) {
1965
+ const _set = (nextSegment, subject, value, cursor) => {
1966
+ const segment = nextSegment();
1967
+ if (segment === undefined) {
1934
1968
  return value;
1935
- } else if (pointer.length > 1) {
1969
+ } else if (nextSegment(EXISTS)) {
1936
1970
  if (Array.isArray(subject)) {
1937
- const index = pointer.shift();
1938
1971
  const clonedSubject = [...subject];
1939
- clonedSubject[index] = _set(pointer, applySegment(subject, index, cursor), value, append(index, cursor));
1972
+ clonedSubject[segment] = _set(nextSegment, applySegment(subject, segment, cursor), value, append(segment, cursor));
1940
1973
  return clonedSubject;
1941
1974
  } else {
1942
- const segment = pointer.shift();
1943
- return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
1975
+ return { ...subject, [segment]: _set(nextSegment, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
1944
1976
  }
1945
1977
  } else if (Array.isArray(subject)) {
1946
1978
  const clonedSubject = [...subject];
1947
- const segment = computeSegment(subject, pointer[0]);
1948
- clonedSubject[segment] = value;
1979
+ clonedSubject[computeSegment(subject, segment)] = value;
1949
1980
  return clonedSubject;
1950
1981
  } else if (typeof subject === "object" && subject !== null) {
1951
- return { ...subject, [pointer[0]]: value };
1982
+ return { ...subject, [segment]: value };
1952
1983
  } else {
1953
- return applySegment(subject, pointer[0], cursor);
1984
+ return applySegment(subject, segment, cursor);
1954
1985
  }
1955
1986
  };
1956
1987
 
1957
1988
  const assign = (pointer, subject = undefined, value = undefined) => {
1958
- const ptr = compile$N(pointer);
1959
- const fn = curry$a((subject, value) => _assign(ptr, subject, value, nil$2));
1989
+ const nextSegment = segmentGenerator(pointer);
1990
+ const fn = curry$a((subject, value) => _assign(nextSegment, subject, value, nil$2));
1960
1991
  return subject === undefined ? fn : fn(subject, value);
1961
1992
  };
1962
1993
 
1963
- const _assign = (pointer, subject, value, cursor) => {
1964
- if (pointer.length === 0) {
1994
+ const _assign = (nextSegment, subject, value, cursor) => {
1995
+ const segment = nextSegment();
1996
+ if (segment === undefined) {
1965
1997
  return;
1966
- } else if (pointer.length === 1 && !isScalar(subject)) {
1967
- const segment = computeSegment(subject, pointer[0]);
1968
- subject[segment] = value;
1998
+ } else if (!nextSegment(EXISTS) && !isScalar(subject)) {
1999
+ subject[computeSegment(subject, segment)] = value;
1969
2000
  } else {
1970
- const segment = pointer.shift();
1971
- _assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
2001
+ _assign(nextSegment, applySegment(subject, segment, cursor), value, append(segment, cursor));
1972
2002
  }
1973
2003
  };
1974
2004
 
1975
2005
  const unset = (pointer, subject = undefined) => {
1976
- const ptr = compile$N(pointer);
1977
- const fn = (subject) => _unset(ptr, subject, nil$2);
2006
+ const nextSegment = segmentGenerator(pointer);
2007
+ const fn = (subject) => _unset(nextSegment, subject, nil$2);
1978
2008
  return subject === undefined ? fn : fn(subject);
1979
2009
  };
1980
2010
 
1981
- const _unset = (pointer, subject, cursor) => {
1982
- if (pointer.length == 0) {
1983
- return undefined;
1984
- } else if (pointer.length > 1) {
1985
- const segment = pointer.shift();
2011
+ const _unset = (nextSegment, subject, cursor) => {
2012
+ const segment = nextSegment();
2013
+ if (segment === undefined) {
2014
+ return;
2015
+ } else if (nextSegment(EXISTS)) {
1986
2016
  const value = applySegment(subject, segment, cursor);
1987
- return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
2017
+ return { ...subject, [segment]: _unset(nextSegment, value, append(segment, cursor)) };
1988
2018
  } else if (Array.isArray(subject)) {
1989
- return subject.filter((_, ndx) => ndx != pointer[0]);
2019
+ const clonedSubject = [...subject];
2020
+ delete clonedSubject[computeSegment(subject, segment)];
2021
+ return clonedSubject;
1990
2022
  } else if (typeof subject === "object" && subject !== null) {
1991
2023
  // eslint-disable-next-line no-unused-vars
1992
- const { [pointer[0]]: _, ...result } = subject;
2024
+ const { [segment]: _, ...result } = subject;
1993
2025
  return result;
1994
2026
  } else {
1995
- return applySegment(subject, pointer[0], cursor);
2027
+ return applySegment(subject, segment, cursor);
1996
2028
  }
1997
2029
  };
1998
2030
 
1999
2031
  const remove = (pointer, subject = undefined) => {
2000
- const ptr = compile$N(pointer);
2001
- const fn = (subject) => _remove(ptr, subject, nil$2);
2032
+ const nextSegment = segmentGenerator(pointer);
2033
+ const fn = (subject) => _remove(nextSegment, subject, nil$2);
2002
2034
  return subject === undefined ? fn : fn(subject);
2003
2035
  };
2004
2036
 
2005
- const _remove = (pointer, subject, cursor) => {
2006
- if (pointer.length === 0) {
2037
+ const _remove = (nextSegment, subject, cursor) => {
2038
+ const segment = nextSegment();
2039
+ if (segment === undefined) {
2007
2040
  return;
2008
- } else if (pointer.length > 1) {
2009
- const segment = pointer.shift();
2041
+ } else if (nextSegment(EXISTS)) {
2010
2042
  const value = applySegment(subject, segment, cursor);
2011
- _remove(pointer, value, append(segment, cursor));
2012
- } else if (Array.isArray(subject)) {
2013
- subject.splice(pointer[0], 1);
2014
- } else if (typeof subject === "object" && subject !== null) {
2015
- delete subject[pointer[0]];
2043
+ _remove(nextSegment, value, append(segment, cursor));
2044
+ } else if (!isScalar(subject)) {
2045
+ delete subject[segment];
2016
2046
  } else {
2017
- applySegment(subject, pointer[0], cursor);
2047
+ applySegment(subject, segment, cursor);
2018
2048
  }
2019
2049
  };
2020
2050
 
@@ -2235,7 +2265,11 @@ var lib$3 = {
2235
2265
  allValues: allValues
2236
2266
  };
2237
2267
 
2238
- var moo$1 = {exports: {}};
2268
+ var mooExports = {};
2269
+ var moo$1 = {
2270
+ get exports(){ return mooExports; },
2271
+ set exports(v){ mooExports = v; },
2272
+ };
2239
2273
 
2240
2274
  (function (module) {
2241
2275
  (function(root, factory) {
@@ -2290,6 +2324,38 @@ var moo$1 = {exports: {}};
2290
2324
  }
2291
2325
  }
2292
2326
 
2327
+ function pad(s, length) {
2328
+ if (s.length > length) {
2329
+ return s
2330
+ }
2331
+ return Array(length - s.length + 1).join(" ") + s
2332
+ }
2333
+
2334
+ function lastNLines(string, numLines) {
2335
+ var position = string.length;
2336
+ var lineBreaks = 0;
2337
+ while (true) {
2338
+ var idx = string.lastIndexOf("\n", position - 1);
2339
+ if (idx === -1) {
2340
+ break;
2341
+ } else {
2342
+ lineBreaks++;
2343
+ }
2344
+ position = idx;
2345
+ if (lineBreaks === numLines) {
2346
+ break;
2347
+ }
2348
+ if (position === 0) {
2349
+ break;
2350
+ }
2351
+ }
2352
+ var startPosition =
2353
+ lineBreaks < numLines ?
2354
+ 0 :
2355
+ position + 1;
2356
+ return string.substring(startPosition).split("\n")
2357
+ }
2358
+
2293
2359
  function objectToRules(object) {
2294
2360
  var keys = Object.getOwnPropertyNames(object);
2295
2361
  var result = [];
@@ -2572,39 +2638,31 @@ var moo$1 = {exports: {}};
2572
2638
  }
2573
2639
 
2574
2640
  function keywordTransform(map) {
2575
- var reverseMap = Object.create(null);
2576
- var byLength = Object.create(null);
2641
+
2642
+ // Use a JavaScript Map to map keywords to their corresponding token type
2643
+ // unless Map is unsupported, then fall back to using an Object:
2644
+ var isMap = typeof Map !== 'undefined';
2645
+ var reverseMap = isMap ? new Map : Object.create(null);
2646
+
2577
2647
  var types = Object.getOwnPropertyNames(map);
2578
2648
  for (var i = 0; i < types.length; i++) {
2579
2649
  var tokenType = types[i];
2580
2650
  var item = map[tokenType];
2581
2651
  var keywordList = Array.isArray(item) ? item : [item];
2582
2652
  keywordList.forEach(function(keyword) {
2583
- (byLength[keyword.length] = byLength[keyword.length] || []).push(keyword);
2584
2653
  if (typeof keyword !== 'string') {
2585
2654
  throw new Error("keyword must be string (in keyword '" + tokenType + "')")
2586
2655
  }
2587
- reverseMap[keyword] = tokenType;
2656
+ if (isMap) {
2657
+ reverseMap.set(keyword, tokenType);
2658
+ } else {
2659
+ reverseMap[keyword] = tokenType;
2660
+ }
2588
2661
  });
2589
2662
  }
2590
-
2591
- // fast string lookup
2592
- // https://jsperf.com/string-lookups
2593
- function str(x) { return JSON.stringify(x) }
2594
- var source = '';
2595
- source += 'switch (value.length) {\n';
2596
- for (var length in byLength) {
2597
- var keywords = byLength[length];
2598
- source += 'case ' + length + ':\n';
2599
- source += 'switch (value) {\n';
2600
- keywords.forEach(function(keyword) {
2601
- var tokenType = reverseMap[keyword];
2602
- source += 'case ' + str(keyword) + ': return ' + str(tokenType) + '\n';
2603
- });
2604
- source += '}\n';
2663
+ return function(k) {
2664
+ return isMap ? reverseMap.get(k) : reverseMap[k]
2605
2665
  }
2606
- source += '}\n';
2607
- return Function('value', source) // type
2608
2666
  }
2609
2667
 
2610
2668
  /***************************************************************************/
@@ -2623,6 +2681,7 @@ var moo$1 = {exports: {}};
2623
2681
  this.line = info ? info.line : 1;
2624
2682
  this.col = info ? info.col : 1;
2625
2683
  this.queuedToken = info ? info.queuedToken : null;
2684
+ this.queuedText = info ? info.queuedText: "";
2626
2685
  this.queuedThrow = info ? info.queuedThrow : null;
2627
2686
  this.setState(info ? info.state : this.startState);
2628
2687
  this.stack = info && info.stack ? info.stack.slice() : [];
@@ -2636,6 +2695,7 @@ var moo$1 = {exports: {}};
2636
2695
  state: this.state,
2637
2696
  stack: this.stack.slice(),
2638
2697
  queuedToken: this.queuedToken,
2698
+ queuedText: this.queuedText,
2639
2699
  queuedThrow: this.queuedThrow,
2640
2700
  }
2641
2701
  };
@@ -2767,7 +2827,8 @@ var moo$1 = {exports: {}};
2767
2827
 
2768
2828
  // throw, if no rule with {error: true}
2769
2829
  if (group.shouldThrow) {
2770
- throw new Error(this.formatError(token, "invalid syntax"))
2830
+ var err = new Error(this.formatError(token, "invalid syntax"));
2831
+ throw err;
2771
2832
  }
2772
2833
 
2773
2834
  if (group.pop) this.popState();
@@ -2808,13 +2869,28 @@ var moo$1 = {exports: {}};
2808
2869
  col: this.col,
2809
2870
  };
2810
2871
  }
2811
- var start = Math.max(0, token.offset - token.col + 1);
2812
- var eol = token.lineBreaks ? token.text.indexOf('\n') : token.text.length;
2813
- var firstLine = this.buffer.substring(start, token.offset + eol);
2814
- message += " at line " + token.line + " col " + token.col + ":\n\n";
2815
- message += " " + firstLine + "\n";
2816
- message += " " + Array(token.col).join(" ") + "^";
2817
- return message
2872
+
2873
+ var numLinesAround = 2;
2874
+ var firstDisplayedLine = Math.max(token.line - numLinesAround, 1);
2875
+ var lastDisplayedLine = token.line + numLinesAround;
2876
+ var lastLineDigits = String(lastDisplayedLine).length;
2877
+ var displayedLines = lastNLines(
2878
+ this.buffer,
2879
+ (this.line - token.line) + numLinesAround + 1
2880
+ )
2881
+ .slice(0, 5);
2882
+ var errorLines = [];
2883
+ errorLines.push(message + " at line " + token.line + " col " + token.col + ":");
2884
+ errorLines.push("");
2885
+ for (var i = 0; i < displayedLines.length; i++) {
2886
+ var line = displayedLines[i];
2887
+ var lineNo = firstDisplayedLine + i;
2888
+ errorLines.push(pad(String(lineNo), lastLineDigits) + " " + line);
2889
+ if (lineNo === token.line) {
2890
+ errorLines.push(pad("", lastLineDigits + token.col + 1) + "^");
2891
+ }
2892
+ }
2893
+ return errorLines.join("\n")
2818
2894
  };
2819
2895
 
2820
2896
  Lexer.prototype.clone = function() {
@@ -2837,7 +2913,7 @@ var moo$1 = {exports: {}};
2837
2913
  }));
2838
2914
  } (moo$1));
2839
2915
 
2840
- const moo = moo$1.exports;
2916
+ const moo = mooExports;
2841
2917
 
2842
2918
 
2843
2919
  const digit = `[0-9]`;
@@ -3100,8 +3176,8 @@ var contentType = {};
3100
3176
  * obs-text = %x80-FF
3101
3177
  * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
3102
3178
  */
3103
- var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
3104
- var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
3179
+ var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g; // eslint-disable-line no-control-regex
3180
+ var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/; // eslint-disable-line no-control-regex
3105
3181
  var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
3106
3182
 
3107
3183
  /**
@@ -3110,7 +3186,7 @@ var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
3110
3186
  * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
3111
3187
  * obs-text = %x80-FF
3112
3188
  */
3113
- var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
3189
+ var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g; // eslint-disable-line no-control-regex
3114
3190
 
3115
3191
  /**
3116
3192
  * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
@@ -3199,7 +3275,7 @@ function parse$1 (string) {
3199
3275
 
3200
3276
  var index = header.indexOf(';');
3201
3277
  var type = index !== -1
3202
- ? header.substr(0, index).trim()
3278
+ ? header.slice(0, index).trim()
3203
3279
  : header.trim();
3204
3280
 
3205
3281
  if (!TYPE_REGEXP.test(type)) {
@@ -3225,11 +3301,14 @@ function parse$1 (string) {
3225
3301
  key = match[1].toLowerCase();
3226
3302
  value = match[2];
3227
3303
 
3228
- if (value[0] === '"') {
3229
- // remove quotes and escapes
3230
- value = value
3231
- .substr(1, value.length - 2)
3232
- .replace(QESC_REGEXP, '$1');
3304
+ if (value.charCodeAt(0) === 0x22 /* " */) {
3305
+ // remove quotes
3306
+ value = value.slice(1, -1);
3307
+
3308
+ // remove escapes
3309
+ if (value.indexOf('\\') !== -1) {
3310
+ value = value.replace(QESC_REGEXP, '$1');
3311
+ }
3233
3312
  }
3234
3313
 
3235
3314
  obj.parameters[key] = value;
@@ -3678,13 +3757,13 @@ var schema$5 = {
3678
3757
  toSchema
3679
3758
  };
3680
3759
 
3681
- class InvalidSchemaError$3 extends Error {
3760
+ let InvalidSchemaError$3 = class InvalidSchemaError extends Error {
3682
3761
  constructor(output) {
3683
3762
  super("Invalid Schema");
3684
3763
  this.name = this.constructor.name;
3685
3764
  this.output = output;
3686
3765
  }
3687
- }
3766
+ };
3688
3767
 
3689
3768
  var invalidSchemaError = InvalidSchemaError$3;
3690
3769
 
@@ -3697,7 +3776,7 @@ const interpret$M = () => true;
3697
3776
  var metaData$4 = { compile: compile$M, interpret: interpret$M };
3698
3777
 
3699
3778
  const curry = justCurryIt$1;
3700
- const PubSub$1 = pubsub.exports;
3779
+ const PubSub$1 = pubsubExports;
3701
3780
  const { resolveUrl } = common$1;
3702
3781
  const Instance$C = instance;
3703
3782
  const Schema$O = schema$5;
@@ -3786,7 +3865,13 @@ const setShouldMetaValidate = (isEnabled) => {
3786
3865
  };
3787
3866
 
3788
3867
  const _keywords = {};
3789
- const getKeyword = (id) => _keywords[id] || metaData$3;
3868
+ const getKeyword = (id) => {
3869
+ if (!_keywords[id]) {
3870
+ addKeyword(id, metaData$3);
3871
+ }
3872
+
3873
+ return _keywords[id];
3874
+ };
3790
3875
  const hasKeyword = (id) => id in _keywords;
3791
3876
  const addKeyword = (id, keywordHandler) => {
3792
3877
  _keywords[id] = {
@@ -3903,7 +3988,7 @@ var core$2 = {
3903
3988
  };
3904
3989
 
3905
3990
  const Pact$9 = lib$3;
3906
- const PubSub = pubsub.exports;
3991
+ const PubSub = pubsubExports;
3907
3992
  const Core$x = core$2;
3908
3993
  const Instance$B = instance;
3909
3994
  const Schema$N = schema$5;
@@ -4064,7 +4149,16 @@ const interpret$I = ([numberOfItems, additionalItems], instance, ast, dynamicAnc
4064
4149
  };
4065
4150
 
4066
4151
  const collectEvaluatedItems$d = (keywordValue, instance, ast, dynamicAnchors) => {
4067
- return interpret$I(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$y.map((item, ndx) => ndx, instance));
4152
+ if (!interpret$I(keywordValue, instance, ast, dynamicAnchors)) {
4153
+ return false;
4154
+ }
4155
+
4156
+ const evaluatedIndexes = new Set();
4157
+ for (let ndx = keywordValue[0]; ndx < Instance$y.length(instance); ndx++) {
4158
+ evaluatedIndexes.add(ndx);
4159
+ }
4160
+
4161
+ return evaluatedIndexes;
4068
4162
  };
4069
4163
 
4070
4164
  var additionalItems6 = { compile: compile$I, interpret: interpret$I, collectEvaluatedItems: collectEvaluatedItems$d };
@@ -4863,15 +4957,14 @@ const compile$7 = async (dynamicRef, ast) => {
4863
4957
  const [, fragment] = splitUrl(Schema$d.value(dynamicRef));
4864
4958
  const referencedSchema = await Schema$d.get(Schema$d.value(dynamicRef), dynamicRef);
4865
4959
  await Core$a.compileSchema(referencedSchema, ast);
4866
- return [referencedSchema.id, fragment];
4960
+ return [referencedSchema.id, fragment, Schema$d.uri(referencedSchema)];
4867
4961
  };
4868
4962
 
4869
- const interpret$7 = ([id, fragment], instance, ast, dynamicAnchors) => {
4963
+ const interpret$7 = ([id, fragment, ref], instance, ast, dynamicAnchors) => {
4870
4964
  if (fragment in ast.metaData[id].dynamicAnchors) {
4871
4965
  return Core$a.interpretSchema(dynamicAnchors[fragment], instance, ast, dynamicAnchors);
4872
4966
  } else {
4873
- const pointer = Schema$d.getAnchorPointer(ast.metaData[id], fragment);
4874
- return Core$a.interpretSchema(`${id}#${encodeURI(pointer)}`, instance, ast, dynamicAnchors);
4967
+ return Core$a.interpretSchema(ref, instance, ast, dynamicAnchors);
4875
4968
  }
4876
4969
  };
4877
4970
 
@@ -6596,5 +6689,5 @@ var lib = {
6596
6689
  InvalidSchemaError: InvalidSchemaError
6597
6690
  };
6598
6691
 
6599
- exports["default"] = lib;
6692
+ exports.default = lib;
6600
6693
  //# sourceMappingURL=json-schema-cjs.js.map