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