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