@hyperjump/json-schema 0.23.1 → 0.23.2
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 +516 -1632
- package/dist/json-schema-amd.js.map +1 -1
- package/dist/json-schema-amd.min.js +2 -2
- package/dist/json-schema-amd.min.js.map +1 -1
- package/dist/json-schema-cjs.js +516 -1632
- package/dist/json-schema-cjs.js.map +1 -1
- package/dist/json-schema-cjs.min.js +2 -2
- package/dist/json-schema-cjs.min.js.map +1 -1
- package/dist/json-schema-esm.js +516 -1632
- package/dist/json-schema-esm.js.map +1 -1
- package/dist/json-schema-esm.min.js +2 -2
- package/dist/json-schema-esm.min.js.map +1 -1
- package/dist/json-schema-iife.js +516 -1632
- package/dist/json-schema-iife.js.map +1 -1
- package/dist/json-schema-iife.min.js +2 -2
- package/dist/json-schema-iife.min.js.map +1 -1
- package/dist/json-schema-system.js +516 -1632
- package/dist/json-schema-system.js.map +1 -1
- package/dist/json-schema-system.min.js +2 -2
- package/dist/json-schema-system.min.js.map +1 -1
- package/dist/json-schema-umd.js +516 -1632
- package/dist/json-schema-umd.js.map +1 -1
- package/dist/json-schema-umd.min.js +2 -2
- package/dist/json-schema-umd.min.js.map +1 -1
- package/lib/draft-06.js +2 -2
- package/lib/draft-07.js +2 -2
- package/lib/draft-2019-09.js +2 -2
- package/lib/draft-2020-12.js +2 -2
- package/lib/keywords/index.js +0 -2
- package/lib/keywords/maxLength.js +1 -1
- package/lib/keywords/minLength.js +1 -1
- package/package.json +1 -1
- package/lib/keywords/maxLength6.js +0 -7
- package/lib/keywords/minLength6.js +0 -7
package/dist/json-schema-amd.js
CHANGED
|
@@ -2,7 +2,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2
2
|
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
|
|
5
|
-
var justCurryIt$
|
|
5
|
+
var justCurryIt$1 = curry$b;
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
function add(a, b, c) {
|
|
@@ -27,7 +27,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
27
27
|
milesToKm(10); // 16.2
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
-
function curry$
|
|
30
|
+
function curry$b(fn, arity) {
|
|
31
31
|
return function curried() {
|
|
32
32
|
if (arity == null) {
|
|
33
33
|
arity = fn.length;
|
|
@@ -1898,84 +1898,91 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1898
1898
|
|
|
1899
1899
|
var common$1 = { jsonTypeOf: jsonTypeOf$2, resolveUrl: resolveUrl$3, urlFragment: urlFragment$1, pathRelative: pathRelative$1 };
|
|
1900
1900
|
|
|
1901
|
-
const curry$
|
|
1901
|
+
const curry$a = justCurryIt$1;
|
|
1902
1902
|
|
|
1903
1903
|
|
|
1904
|
-
const nil$
|
|
1904
|
+
const nil$2 = "";
|
|
1905
1905
|
|
|
1906
|
-
const compile$
|
|
1906
|
+
const compile$N = (pointer) => {
|
|
1907
1907
|
if (pointer.length > 0 && pointer[0] !== "/") {
|
|
1908
1908
|
throw Error("Invalid JSON Pointer");
|
|
1909
1909
|
}
|
|
1910
1910
|
|
|
1911
|
-
return pointer.split("/").slice(1).map(unescape
|
|
1911
|
+
return pointer.split("/").slice(1).map(unescape);
|
|
1912
1912
|
};
|
|
1913
1913
|
|
|
1914
|
-
const get$
|
|
1915
|
-
const ptr = compile$
|
|
1914
|
+
const get$2 = (pointer, value = undefined) => {
|
|
1915
|
+
const ptr = compile$N(pointer);
|
|
1916
1916
|
|
|
1917
1917
|
const fn = (value) => ptr.reduce(([value, pointer], segment) => {
|
|
1918
|
-
return [applySegment
|
|
1918
|
+
return [applySegment(value, segment, pointer), append(segment, pointer)];
|
|
1919
1919
|
}, [value, ""])[0];
|
|
1920
1920
|
|
|
1921
1921
|
return value === undefined ? fn : fn(value);
|
|
1922
1922
|
};
|
|
1923
1923
|
|
|
1924
|
-
const set
|
|
1925
|
-
const ptr = compile$
|
|
1926
|
-
const fn = curry$
|
|
1924
|
+
const set = (pointer, subject = undefined, value = undefined) => {
|
|
1925
|
+
const ptr = compile$N(pointer);
|
|
1926
|
+
const fn = curry$a((subject, value) => _set(ptr, subject, value, nil$2));
|
|
1927
1927
|
return subject === undefined ? fn : fn(subject, value);
|
|
1928
1928
|
};
|
|
1929
1929
|
|
|
1930
|
-
const _set
|
|
1930
|
+
const _set = (pointer, subject, value, cursor) => {
|
|
1931
1931
|
if (pointer.length === 0) {
|
|
1932
1932
|
return value;
|
|
1933
1933
|
} else if (pointer.length > 1) {
|
|
1934
|
-
|
|
1935
|
-
|
|
1934
|
+
if (Array.isArray(subject)) {
|
|
1935
|
+
const index = pointer.shift();
|
|
1936
|
+
const clonedSubject = [...subject];
|
|
1937
|
+
clonedSubject[index] = _set(pointer, applySegment(subject, index, cursor), value, append(index, cursor));
|
|
1938
|
+
return clonedSubject;
|
|
1939
|
+
} else {
|
|
1940
|
+
const segment = pointer.shift();
|
|
1941
|
+
return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
|
|
1942
|
+
}
|
|
1936
1943
|
} else if (Array.isArray(subject)) {
|
|
1937
1944
|
const clonedSubject = [...subject];
|
|
1938
|
-
const segment = computeSegment
|
|
1945
|
+
const segment = computeSegment(subject, pointer[0]);
|
|
1939
1946
|
clonedSubject[segment] = value;
|
|
1940
1947
|
return clonedSubject;
|
|
1941
1948
|
} else if (typeof subject === "object" && subject !== null) {
|
|
1942
1949
|
return { ...subject, [pointer[0]]: value };
|
|
1943
1950
|
} else {
|
|
1944
|
-
return applySegment
|
|
1951
|
+
return applySegment(subject, pointer[0], cursor);
|
|
1945
1952
|
}
|
|
1946
1953
|
};
|
|
1947
1954
|
|
|
1948
|
-
const assign
|
|
1949
|
-
const ptr = compile$
|
|
1950
|
-
const fn = curry$
|
|
1955
|
+
const assign = (pointer, subject = undefined, value = undefined) => {
|
|
1956
|
+
const ptr = compile$N(pointer);
|
|
1957
|
+
const fn = curry$a((subject, value) => _assign(ptr, subject, value, nil$2));
|
|
1951
1958
|
return subject === undefined ? fn : fn(subject, value);
|
|
1952
1959
|
};
|
|
1953
1960
|
|
|
1954
|
-
const _assign
|
|
1961
|
+
const _assign = (pointer, subject, value, cursor) => {
|
|
1955
1962
|
if (pointer.length === 0) {
|
|
1956
1963
|
return;
|
|
1957
|
-
} else if (pointer.length === 1 && !isScalar
|
|
1958
|
-
const segment = computeSegment
|
|
1964
|
+
} else if (pointer.length === 1 && !isScalar(subject)) {
|
|
1965
|
+
const segment = computeSegment(subject, pointer[0]);
|
|
1959
1966
|
subject[segment] = value;
|
|
1960
1967
|
} else {
|
|
1961
1968
|
const segment = pointer.shift();
|
|
1962
|
-
_assign
|
|
1969
|
+
_assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
|
|
1963
1970
|
}
|
|
1964
1971
|
};
|
|
1965
1972
|
|
|
1966
|
-
const unset
|
|
1967
|
-
const ptr = compile$
|
|
1968
|
-
const fn = (subject) => _unset
|
|
1973
|
+
const unset = (pointer, subject = undefined) => {
|
|
1974
|
+
const ptr = compile$N(pointer);
|
|
1975
|
+
const fn = (subject) => _unset(ptr, subject, nil$2);
|
|
1969
1976
|
return subject === undefined ? fn : fn(subject);
|
|
1970
1977
|
};
|
|
1971
1978
|
|
|
1972
|
-
const _unset
|
|
1979
|
+
const _unset = (pointer, subject, cursor) => {
|
|
1973
1980
|
if (pointer.length == 0) {
|
|
1974
1981
|
return undefined;
|
|
1975
1982
|
} else if (pointer.length > 1) {
|
|
1976
1983
|
const segment = pointer.shift();
|
|
1977
|
-
const value = applySegment
|
|
1978
|
-
return { ...subject, [segment]: _unset
|
|
1984
|
+
const value = applySegment(subject, segment, cursor);
|
|
1985
|
+
return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
|
|
1979
1986
|
} else if (Array.isArray(subject)) {
|
|
1980
1987
|
return subject.filter((_, ndx) => ndx != pointer[0]);
|
|
1981
1988
|
} else if (typeof subject === "object" && subject !== null) {
|
|
@@ -1983,54 +1990,54 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1983
1990
|
const { [pointer[0]]: _, ...result } = subject;
|
|
1984
1991
|
return result;
|
|
1985
1992
|
} else {
|
|
1986
|
-
return applySegment
|
|
1993
|
+
return applySegment(subject, pointer[0], cursor);
|
|
1987
1994
|
}
|
|
1988
1995
|
};
|
|
1989
1996
|
|
|
1990
|
-
const remove
|
|
1991
|
-
const ptr = compile$
|
|
1992
|
-
const fn = (subject) => _remove
|
|
1997
|
+
const remove = (pointer, subject = undefined) => {
|
|
1998
|
+
const ptr = compile$N(pointer);
|
|
1999
|
+
const fn = (subject) => _remove(ptr, subject, nil$2);
|
|
1993
2000
|
return subject === undefined ? fn : fn(subject);
|
|
1994
2001
|
};
|
|
1995
2002
|
|
|
1996
|
-
const _remove
|
|
2003
|
+
const _remove = (pointer, subject, cursor) => {
|
|
1997
2004
|
if (pointer.length === 0) {
|
|
1998
2005
|
return;
|
|
1999
2006
|
} else if (pointer.length > 1) {
|
|
2000
2007
|
const segment = pointer.shift();
|
|
2001
|
-
const value = applySegment
|
|
2002
|
-
_remove
|
|
2008
|
+
const value = applySegment(subject, segment, cursor);
|
|
2009
|
+
_remove(pointer, value, append(segment, cursor));
|
|
2003
2010
|
} else if (Array.isArray(subject)) {
|
|
2004
2011
|
subject.splice(pointer[0], 1);
|
|
2005
2012
|
} else if (typeof subject === "object" && subject !== null) {
|
|
2006
2013
|
delete subject[pointer[0]];
|
|
2007
2014
|
} else {
|
|
2008
|
-
applySegment
|
|
2015
|
+
applySegment(subject, pointer[0], cursor);
|
|
2009
2016
|
}
|
|
2010
2017
|
};
|
|
2011
2018
|
|
|
2012
|
-
const append
|
|
2019
|
+
const append = curry$a((segment, pointer) => pointer + "/" + escape(segment));
|
|
2013
2020
|
|
|
2014
|
-
const escape
|
|
2015
|
-
const unescape
|
|
2016
|
-
const computeSegment
|
|
2021
|
+
const escape = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
|
|
2022
|
+
const unescape = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
|
|
2023
|
+
const computeSegment = (value, segment) => Array.isArray(value) && segment === "-" ? value.length : segment;
|
|
2017
2024
|
|
|
2018
|
-
const applySegment
|
|
2025
|
+
const applySegment = (value, segment, cursor = "") => {
|
|
2019
2026
|
if (value === undefined) {
|
|
2020
2027
|
throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
|
|
2021
2028
|
} else if (value === null) {
|
|
2022
2029
|
throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
|
|
2023
|
-
} else if (isScalar
|
|
2030
|
+
} else if (isScalar(value)) {
|
|
2024
2031
|
throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
|
|
2025
2032
|
} else {
|
|
2026
|
-
const computedSegment = computeSegment
|
|
2033
|
+
const computedSegment = computeSegment(value, segment);
|
|
2027
2034
|
return value[computedSegment];
|
|
2028
2035
|
}
|
|
2029
2036
|
};
|
|
2030
2037
|
|
|
2031
|
-
const isScalar
|
|
2038
|
+
const isScalar = (value) => value === null || typeof value !== "object";
|
|
2032
2039
|
|
|
2033
|
-
var lib$
|
|
2040
|
+
var lib$3 = { nil: nil$2, append, get: get$2, set, assign, unset, remove };
|
|
2034
2041
|
|
|
2035
2042
|
const $__value = Symbol("$__value");
|
|
2036
2043
|
const $__href = Symbol("$__href");
|
|
@@ -2046,16 +2053,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2046
2053
|
|
|
2047
2054
|
var reference = { cons: cons$1, isReference, href, value: value$2 };
|
|
2048
2055
|
|
|
2049
|
-
const JsonPointer$
|
|
2050
|
-
const curry$
|
|
2056
|
+
const JsonPointer$1 = lib$3;
|
|
2057
|
+
const curry$9 = justCurryIt$1;
|
|
2051
2058
|
const { resolveUrl: resolveUrl$2, jsonTypeOf: jsonTypeOf$1 } = common$1;
|
|
2052
2059
|
const Reference$2 = reference;
|
|
2053
2060
|
|
|
2054
2061
|
|
|
2055
|
-
const nil$
|
|
2056
|
-
const cons = (instance, id = "") => Object.freeze({ ...nil$
|
|
2062
|
+
const nil$1 = Object.freeze({ id: "", pointer: "", instance: undefined, value: undefined });
|
|
2063
|
+
const cons = (instance, id = "") => Object.freeze({ ...nil$1, id: resolveUrl$2(id, ""), instance, value: instance });
|
|
2057
2064
|
|
|
2058
|
-
const get$
|
|
2065
|
+
const get$1 = (url, instance = nil$1) => {
|
|
2059
2066
|
if (!url.startsWith("#")) {
|
|
2060
2067
|
throw Error(`No JSON document found at '${url.split("#")[0]}'`);
|
|
2061
2068
|
}
|
|
@@ -2066,126 +2073,48 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2066
2073
|
const uri$1 = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
|
|
2067
2074
|
const value$1 = (doc) => Reference$2.isReference(doc.value) ? Reference$2.value(doc.value) : doc.value;
|
|
2068
2075
|
const has$1 = (key, doc) => key in value$1(doc);
|
|
2069
|
-
const typeOf$1 = curry$
|
|
2076
|
+
const typeOf$1 = curry$9((doc, type) => jsonTypeOf$1(value$1(doc), type));
|
|
2070
2077
|
|
|
2071
2078
|
const step$1 = (key, doc) => Object.freeze({
|
|
2072
2079
|
...doc,
|
|
2073
|
-
pointer: JsonPointer$
|
|
2080
|
+
pointer: JsonPointer$1.append(key, doc.pointer),
|
|
2074
2081
|
value: value$1(doc)[key]
|
|
2075
2082
|
});
|
|
2076
2083
|
|
|
2077
|
-
const entries$
|
|
2084
|
+
const entries$3 = (doc) => Object.keys(value$1(doc))
|
|
2078
2085
|
.map((key) => [key, step$1(key, doc)]);
|
|
2079
2086
|
|
|
2080
2087
|
const keys$1 = (doc) => Object.keys(value$1(doc));
|
|
2081
2088
|
|
|
2082
|
-
const map$
|
|
2089
|
+
const map$4 = curry$9((fn, doc) => value$1(doc)
|
|
2083
2090
|
.map((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2084
2091
|
|
|
2085
|
-
const forEach = curry$
|
|
2092
|
+
const forEach = curry$9((fn, doc) => value$1(doc)
|
|
2086
2093
|
.forEach((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2087
2094
|
|
|
2088
|
-
const filter$
|
|
2095
|
+
const filter$1 = curry$9((fn, doc) => value$1(doc)
|
|
2089
2096
|
.map((item, ndx, array, thisArg) => step$1(ndx, doc))
|
|
2090
2097
|
.filter((item, ndx, array, thisArg) => fn(item, ndx, array, thisArg)));
|
|
2091
2098
|
|
|
2092
|
-
const reduce$
|
|
2099
|
+
const reduce$3 = curry$9((fn, acc, doc) => value$1(doc)
|
|
2093
2100
|
.reduce((acc, item, ndx) => fn(acc, step$1(ndx, doc), ndx), acc));
|
|
2094
2101
|
|
|
2095
|
-
const every$
|
|
2102
|
+
const every$1 = curry$9((fn, doc) => value$1(doc)
|
|
2096
2103
|
.every((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2097
2104
|
|
|
2098
|
-
const some$
|
|
2105
|
+
const some$1 = curry$9((fn, doc) => value$1(doc)
|
|
2099
2106
|
.some((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2100
2107
|
|
|
2101
2108
|
const length$1 = (doc) => value$1(doc).length;
|
|
2102
2109
|
|
|
2103
2110
|
var instance = {
|
|
2104
|
-
nil: nil$
|
|
2105
|
-
step: step$1, entries: entries$
|
|
2106
|
-
};
|
|
2107
|
-
|
|
2108
|
-
var entries$4 = async (doc) => Object.entries(await doc);
|
|
2109
|
-
|
|
2110
|
-
const curry$g = justCurryIt$2;
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
var map$6 = curry$g(async (fn, doc) => (await doc).map(fn));
|
|
2114
|
-
|
|
2115
|
-
const curry$f = justCurryIt$2;
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
var reduce$5 = curry$f(async (fn, acc, doc) => {
|
|
2119
|
-
return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
|
|
2120
|
-
});
|
|
2121
|
-
|
|
2122
|
-
const curry$e = justCurryIt$2;
|
|
2123
|
-
const reduce$4 = reduce$5;
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
var filter$1 = curry$e(async (fn, doc, options = {}) => {
|
|
2127
|
-
return reduce$4(async (acc, item) => {
|
|
2128
|
-
return (await fn(item)) ? acc.concat([item]) : acc;
|
|
2129
|
-
}, [], doc, options);
|
|
2130
|
-
});
|
|
2131
|
-
|
|
2132
|
-
const curry$d = justCurryIt$2;
|
|
2133
|
-
const map$5 = map$6;
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
var some$1 = curry$d(async (fn, doc) => {
|
|
2137
|
-
const results = await map$5(fn, doc);
|
|
2138
|
-
return (await Promise.all(results))
|
|
2139
|
-
.some((a) => a);
|
|
2140
|
-
});
|
|
2141
|
-
|
|
2142
|
-
const curry$c = justCurryIt$2;
|
|
2143
|
-
const map$4 = map$6;
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
var every$1 = curry$c(async (fn, doc) => {
|
|
2147
|
-
const results = await map$4(fn, doc);
|
|
2148
|
-
return (await Promise.all(results))
|
|
2149
|
-
.every((a) => a);
|
|
2150
|
-
});
|
|
2151
|
-
|
|
2152
|
-
const curry$b = justCurryIt$2;
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
var pipeline$3 = curry$b((fns, doc) => {
|
|
2156
|
-
return fns.reduce(async (acc, fn) => fn(await acc), doc);
|
|
2157
|
-
});
|
|
2158
|
-
|
|
2159
|
-
var all$1 = (doc) => Promise.all(doc);
|
|
2160
|
-
|
|
2161
|
-
const pipeline$2 = pipeline$3;
|
|
2162
|
-
const entries$3 = entries$4;
|
|
2163
|
-
const reduce$3 = reduce$5;
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
var allValues$1 = (doc) => {
|
|
2167
|
-
return pipeline$2([
|
|
2168
|
-
entries$3,
|
|
2169
|
-
reduce$3(async (acc, [propertyName, propertyValue]) => {
|
|
2170
|
-
acc[propertyName] = await propertyValue;
|
|
2171
|
-
return acc;
|
|
2172
|
-
}, {})
|
|
2173
|
-
], doc);
|
|
2111
|
+
nil: nil$1, cons, get: get$1, uri: uri$1, value: value$1, has: has$1, typeOf: typeOf$1, length: length$1,
|
|
2112
|
+
step: step$1, entries: entries$3, keys: keys$1, map: map$4, forEach, filter: filter$1, reduce: reduce$3, every: every$1, some: some$1
|
|
2174
2113
|
};
|
|
2175
2114
|
|
|
2176
|
-
var
|
|
2177
|
-
entries: entries$4,
|
|
2178
|
-
map: map$6,
|
|
2179
|
-
filter: filter$1,
|
|
2180
|
-
reduce: reduce$5,
|
|
2181
|
-
some: some$1,
|
|
2182
|
-
every: every$1,
|
|
2183
|
-
pipeline: pipeline$3,
|
|
2184
|
-
all: all$1,
|
|
2185
|
-
allValues: allValues$1
|
|
2186
|
-
};
|
|
2115
|
+
var entries$2 = async (doc) => Object.entries(await doc);
|
|
2187
2116
|
|
|
2188
|
-
var justCurryIt
|
|
2117
|
+
var justCurryIt = curry$8;
|
|
2189
2118
|
|
|
2190
2119
|
/*
|
|
2191
2120
|
function add(a, b, c) {
|
|
@@ -2210,7 +2139,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2210
2139
|
milesToKm(10); // 16.2
|
|
2211
2140
|
*/
|
|
2212
2141
|
|
|
2213
|
-
function curry$
|
|
2142
|
+
function curry$8(fn, arity) {
|
|
2214
2143
|
return function curried() {
|
|
2215
2144
|
if (arity == null) {
|
|
2216
2145
|
arity = fn.length;
|
|
@@ -2226,987 +2155,83 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2226
2155
|
};
|
|
2227
2156
|
}
|
|
2228
2157
|
|
|
2229
|
-
const curry$
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
const nil$1 = "";
|
|
2233
|
-
|
|
2234
|
-
const compile$P = (pointer) => {
|
|
2235
|
-
if (pointer.length > 0 && pointer[0] !== "/") {
|
|
2236
|
-
throw Error("Invalid JSON Pointer");
|
|
2237
|
-
}
|
|
2238
|
-
|
|
2239
|
-
return pointer.split("/").slice(1).map(unescape);
|
|
2240
|
-
};
|
|
2241
|
-
|
|
2242
|
-
const get$1 = (pointer, value = undefined) => {
|
|
2243
|
-
const ptr = compile$P(pointer);
|
|
2244
|
-
|
|
2245
|
-
const fn = (value) => ptr.reduce(([value, pointer], segment) => {
|
|
2246
|
-
return [applySegment(value, segment, pointer), append(segment, pointer)];
|
|
2247
|
-
}, [value, ""])[0];
|
|
2248
|
-
|
|
2249
|
-
return value === undefined ? fn : fn(value);
|
|
2250
|
-
};
|
|
2251
|
-
|
|
2252
|
-
const set = (pointer, subject = undefined, value = undefined) => {
|
|
2253
|
-
const ptr = compile$P(pointer);
|
|
2254
|
-
const fn = curry$9((subject, value) => _set(ptr, subject, value, nil$1));
|
|
2255
|
-
return subject === undefined ? fn : fn(subject, value);
|
|
2256
|
-
};
|
|
2257
|
-
|
|
2258
|
-
const _set = (pointer, subject, value, cursor) => {
|
|
2259
|
-
if (pointer.length === 0) {
|
|
2260
|
-
return value;
|
|
2261
|
-
} else if (pointer.length > 1) {
|
|
2262
|
-
if (Array.isArray(subject)) {
|
|
2263
|
-
const index = pointer.shift();
|
|
2264
|
-
const clonedSubject = [...subject];
|
|
2265
|
-
clonedSubject[index] = _set(pointer, applySegment(subject, index, cursor), value, append(index, cursor));
|
|
2266
|
-
return clonedSubject;
|
|
2267
|
-
} else {
|
|
2268
|
-
const segment = pointer.shift();
|
|
2269
|
-
return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
|
|
2270
|
-
}
|
|
2271
|
-
} else if (Array.isArray(subject)) {
|
|
2272
|
-
const clonedSubject = [...subject];
|
|
2273
|
-
const segment = computeSegment(subject, pointer[0]);
|
|
2274
|
-
clonedSubject[segment] = value;
|
|
2275
|
-
return clonedSubject;
|
|
2276
|
-
} else if (typeof subject === "object" && subject !== null) {
|
|
2277
|
-
return { ...subject, [pointer[0]]: value };
|
|
2278
|
-
} else {
|
|
2279
|
-
return applySegment(subject, pointer[0], cursor);
|
|
2280
|
-
}
|
|
2281
|
-
};
|
|
2282
|
-
|
|
2283
|
-
const assign = (pointer, subject = undefined, value = undefined) => {
|
|
2284
|
-
const ptr = compile$P(pointer);
|
|
2285
|
-
const fn = curry$9((subject, value) => _assign(ptr, subject, value, nil$1));
|
|
2286
|
-
return subject === undefined ? fn : fn(subject, value);
|
|
2287
|
-
};
|
|
2288
|
-
|
|
2289
|
-
const _assign = (pointer, subject, value, cursor) => {
|
|
2290
|
-
if (pointer.length === 0) {
|
|
2291
|
-
return;
|
|
2292
|
-
} else if (pointer.length === 1 && !isScalar(subject)) {
|
|
2293
|
-
const segment = computeSegment(subject, pointer[0]);
|
|
2294
|
-
subject[segment] = value;
|
|
2295
|
-
} else {
|
|
2296
|
-
const segment = pointer.shift();
|
|
2297
|
-
_assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
|
|
2298
|
-
}
|
|
2299
|
-
};
|
|
2300
|
-
|
|
2301
|
-
const unset = (pointer, subject = undefined) => {
|
|
2302
|
-
const ptr = compile$P(pointer);
|
|
2303
|
-
const fn = (subject) => _unset(ptr, subject, nil$1);
|
|
2304
|
-
return subject === undefined ? fn : fn(subject);
|
|
2305
|
-
};
|
|
2306
|
-
|
|
2307
|
-
const _unset = (pointer, subject, cursor) => {
|
|
2308
|
-
if (pointer.length == 0) {
|
|
2309
|
-
return undefined;
|
|
2310
|
-
} else if (pointer.length > 1) {
|
|
2311
|
-
const segment = pointer.shift();
|
|
2312
|
-
const value = applySegment(subject, segment, cursor);
|
|
2313
|
-
return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
|
|
2314
|
-
} else if (Array.isArray(subject)) {
|
|
2315
|
-
return subject.filter((_, ndx) => ndx != pointer[0]);
|
|
2316
|
-
} else if (typeof subject === "object" && subject !== null) {
|
|
2317
|
-
// eslint-disable-next-line no-unused-vars
|
|
2318
|
-
const { [pointer[0]]: _, ...result } = subject;
|
|
2319
|
-
return result;
|
|
2320
|
-
} else {
|
|
2321
|
-
return applySegment(subject, pointer[0], cursor);
|
|
2322
|
-
}
|
|
2323
|
-
};
|
|
2324
|
-
|
|
2325
|
-
const remove = (pointer, subject = undefined) => {
|
|
2326
|
-
const ptr = compile$P(pointer);
|
|
2327
|
-
const fn = (subject) => _remove(ptr, subject, nil$1);
|
|
2328
|
-
return subject === undefined ? fn : fn(subject);
|
|
2329
|
-
};
|
|
2330
|
-
|
|
2331
|
-
const _remove = (pointer, subject, cursor) => {
|
|
2332
|
-
if (pointer.length === 0) {
|
|
2333
|
-
return;
|
|
2334
|
-
} else if (pointer.length > 1) {
|
|
2335
|
-
const segment = pointer.shift();
|
|
2336
|
-
const value = applySegment(subject, segment, cursor);
|
|
2337
|
-
_remove(pointer, value, append(segment, cursor));
|
|
2338
|
-
} else if (Array.isArray(subject)) {
|
|
2339
|
-
subject.splice(pointer[0], 1);
|
|
2340
|
-
} else if (typeof subject === "object" && subject !== null) {
|
|
2341
|
-
delete subject[pointer[0]];
|
|
2342
|
-
} else {
|
|
2343
|
-
applySegment(subject, pointer[0], cursor);
|
|
2344
|
-
}
|
|
2345
|
-
};
|
|
2346
|
-
|
|
2347
|
-
const append = curry$9((segment, pointer) => pointer + "/" + escape$1(segment));
|
|
2348
|
-
|
|
2349
|
-
const escape$1 = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
|
|
2350
|
-
const unescape = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
|
|
2351
|
-
const computeSegment = (value, segment) => Array.isArray(value) && segment === "-" ? value.length : segment;
|
|
2352
|
-
|
|
2353
|
-
const applySegment = (value, segment, cursor = "") => {
|
|
2354
|
-
if (value === undefined) {
|
|
2355
|
-
throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
|
|
2356
|
-
} else if (value === null) {
|
|
2357
|
-
throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
|
|
2358
|
-
} else if (isScalar(value)) {
|
|
2359
|
-
throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
|
|
2360
|
-
} else {
|
|
2361
|
-
const computedSegment = computeSegment(value, segment);
|
|
2362
|
-
return value[computedSegment];
|
|
2363
|
-
}
|
|
2364
|
-
};
|
|
2365
|
-
|
|
2366
|
-
const isScalar = (value) => value === null || typeof value !== "object";
|
|
2367
|
-
|
|
2368
|
-
var lib$4 = { nil: nil$1, append, get: get$1, set, assign, unset, remove };
|
|
2369
|
-
|
|
2370
|
-
var moo$1 = {exports: {}};
|
|
2371
|
-
|
|
2372
|
-
(function (module) {
|
|
2373
|
-
(function(root, factory) {
|
|
2374
|
-
if (module.exports) {
|
|
2375
|
-
module.exports = factory();
|
|
2376
|
-
} else {
|
|
2377
|
-
root.moo = factory();
|
|
2378
|
-
}
|
|
2379
|
-
}(commonjsGlobal, function() {
|
|
2380
|
-
|
|
2381
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2382
|
-
var toString = Object.prototype.toString;
|
|
2383
|
-
var hasSticky = typeof new RegExp().sticky === 'boolean';
|
|
2384
|
-
|
|
2385
|
-
/***************************************************************************/
|
|
2386
|
-
|
|
2387
|
-
function isRegExp(o) { return o && toString.call(o) === '[object RegExp]' }
|
|
2388
|
-
function isObject(o) { return o && typeof o === 'object' && !isRegExp(o) && !Array.isArray(o) }
|
|
2389
|
-
|
|
2390
|
-
function reEscape(s) {
|
|
2391
|
-
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')
|
|
2392
|
-
}
|
|
2393
|
-
function reGroups(s) {
|
|
2394
|
-
var re = new RegExp('|' + s);
|
|
2395
|
-
return re.exec('').length - 1
|
|
2396
|
-
}
|
|
2397
|
-
function reCapture(s) {
|
|
2398
|
-
return '(' + s + ')'
|
|
2399
|
-
}
|
|
2400
|
-
function reUnion(regexps) {
|
|
2401
|
-
if (!regexps.length) return '(?!)'
|
|
2402
|
-
var source = regexps.map(function(s) {
|
|
2403
|
-
return "(?:" + s + ")"
|
|
2404
|
-
}).join('|');
|
|
2405
|
-
return "(?:" + source + ")"
|
|
2406
|
-
}
|
|
2407
|
-
|
|
2408
|
-
function regexpOrLiteral(obj) {
|
|
2409
|
-
if (typeof obj === 'string') {
|
|
2410
|
-
return '(?:' + reEscape(obj) + ')'
|
|
2411
|
-
|
|
2412
|
-
} else if (isRegExp(obj)) {
|
|
2413
|
-
// TODO: consider /u support
|
|
2414
|
-
if (obj.ignoreCase) throw new Error('RegExp /i flag not allowed')
|
|
2415
|
-
if (obj.global) throw new Error('RegExp /g flag is implied')
|
|
2416
|
-
if (obj.sticky) throw new Error('RegExp /y flag is implied')
|
|
2417
|
-
if (obj.multiline) throw new Error('RegExp /m flag is implied')
|
|
2418
|
-
return obj.source
|
|
2419
|
-
|
|
2420
|
-
} else {
|
|
2421
|
-
throw new Error('Not a pattern: ' + obj)
|
|
2422
|
-
}
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
|
-
function objectToRules(object) {
|
|
2426
|
-
var keys = Object.getOwnPropertyNames(object);
|
|
2427
|
-
var result = [];
|
|
2428
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2429
|
-
var key = keys[i];
|
|
2430
|
-
var thing = object[key];
|
|
2431
|
-
var rules = [].concat(thing);
|
|
2432
|
-
if (key === 'include') {
|
|
2433
|
-
for (var j = 0; j < rules.length; j++) {
|
|
2434
|
-
result.push({include: rules[j]});
|
|
2435
|
-
}
|
|
2436
|
-
continue
|
|
2437
|
-
}
|
|
2438
|
-
var match = [];
|
|
2439
|
-
rules.forEach(function(rule) {
|
|
2440
|
-
if (isObject(rule)) {
|
|
2441
|
-
if (match.length) result.push(ruleOptions(key, match));
|
|
2442
|
-
result.push(ruleOptions(key, rule));
|
|
2443
|
-
match = [];
|
|
2444
|
-
} else {
|
|
2445
|
-
match.push(rule);
|
|
2446
|
-
}
|
|
2447
|
-
});
|
|
2448
|
-
if (match.length) result.push(ruleOptions(key, match));
|
|
2449
|
-
}
|
|
2450
|
-
return result
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
function arrayToRules(array) {
|
|
2454
|
-
var result = [];
|
|
2455
|
-
for (var i = 0; i < array.length; i++) {
|
|
2456
|
-
var obj = array[i];
|
|
2457
|
-
if (obj.include) {
|
|
2458
|
-
var include = [].concat(obj.include);
|
|
2459
|
-
for (var j = 0; j < include.length; j++) {
|
|
2460
|
-
result.push({include: include[j]});
|
|
2461
|
-
}
|
|
2462
|
-
continue
|
|
2463
|
-
}
|
|
2464
|
-
if (!obj.type) {
|
|
2465
|
-
throw new Error('Rule has no type: ' + JSON.stringify(obj))
|
|
2466
|
-
}
|
|
2467
|
-
result.push(ruleOptions(obj.type, obj));
|
|
2468
|
-
}
|
|
2469
|
-
return result
|
|
2470
|
-
}
|
|
2471
|
-
|
|
2472
|
-
function ruleOptions(type, obj) {
|
|
2473
|
-
if (!isObject(obj)) {
|
|
2474
|
-
obj = { match: obj };
|
|
2475
|
-
}
|
|
2476
|
-
if (obj.include) {
|
|
2477
|
-
throw new Error('Matching rules cannot also include states')
|
|
2478
|
-
}
|
|
2479
|
-
|
|
2480
|
-
// nb. error and fallback imply lineBreaks
|
|
2481
|
-
var options = {
|
|
2482
|
-
defaultType: type,
|
|
2483
|
-
lineBreaks: !!obj.error || !!obj.fallback,
|
|
2484
|
-
pop: false,
|
|
2485
|
-
next: null,
|
|
2486
|
-
push: null,
|
|
2487
|
-
error: false,
|
|
2488
|
-
fallback: false,
|
|
2489
|
-
value: null,
|
|
2490
|
-
type: null,
|
|
2491
|
-
shouldThrow: false,
|
|
2492
|
-
};
|
|
2493
|
-
|
|
2494
|
-
// Avoid Object.assign(), so we support IE9+
|
|
2495
|
-
for (var key in obj) {
|
|
2496
|
-
if (hasOwnProperty.call(obj, key)) {
|
|
2497
|
-
options[key] = obj[key];
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
|
|
2501
|
-
// type transform cannot be a string
|
|
2502
|
-
if (typeof options.type === 'string' && type !== options.type) {
|
|
2503
|
-
throw new Error("Type transform cannot be a string (type '" + options.type + "' for token '" + type + "')")
|
|
2504
|
-
}
|
|
2505
|
-
|
|
2506
|
-
// convert to array
|
|
2507
|
-
var match = options.match;
|
|
2508
|
-
options.match = Array.isArray(match) ? match : match ? [match] : [];
|
|
2509
|
-
options.match.sort(function(a, b) {
|
|
2510
|
-
return isRegExp(a) && isRegExp(b) ? 0
|
|
2511
|
-
: isRegExp(b) ? -1 : isRegExp(a) ? +1 : b.length - a.length
|
|
2512
|
-
});
|
|
2513
|
-
return options
|
|
2514
|
-
}
|
|
2515
|
-
|
|
2516
|
-
function toRules(spec) {
|
|
2517
|
-
return Array.isArray(spec) ? arrayToRules(spec) : objectToRules(spec)
|
|
2518
|
-
}
|
|
2519
|
-
|
|
2520
|
-
var defaultErrorRule = ruleOptions('error', {lineBreaks: true, shouldThrow: true});
|
|
2521
|
-
function compileRules(rules, hasStates) {
|
|
2522
|
-
var errorRule = null;
|
|
2523
|
-
var fast = Object.create(null);
|
|
2524
|
-
var fastAllowed = true;
|
|
2525
|
-
var unicodeFlag = null;
|
|
2526
|
-
var groups = [];
|
|
2527
|
-
var parts = [];
|
|
2528
|
-
|
|
2529
|
-
// If there is a fallback rule, then disable fast matching
|
|
2530
|
-
for (var i = 0; i < rules.length; i++) {
|
|
2531
|
-
if (rules[i].fallback) {
|
|
2532
|
-
fastAllowed = false;
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
for (var i = 0; i < rules.length; i++) {
|
|
2537
|
-
var options = rules[i];
|
|
2538
|
-
|
|
2539
|
-
if (options.include) {
|
|
2540
|
-
// all valid inclusions are removed by states() preprocessor
|
|
2541
|
-
throw new Error('Inheritance is not allowed in stateless lexers')
|
|
2542
|
-
}
|
|
2543
|
-
|
|
2544
|
-
if (options.error || options.fallback) {
|
|
2545
|
-
// errorRule can only be set once
|
|
2546
|
-
if (errorRule) {
|
|
2547
|
-
if (!options.fallback === !errorRule.fallback) {
|
|
2548
|
-
throw new Error("Multiple " + (options.fallback ? "fallback" : "error") + " rules not allowed (for token '" + options.defaultType + "')")
|
|
2549
|
-
} else {
|
|
2550
|
-
throw new Error("fallback and error are mutually exclusive (for token '" + options.defaultType + "')")
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
errorRule = options;
|
|
2554
|
-
}
|
|
2555
|
-
|
|
2556
|
-
var match = options.match.slice();
|
|
2557
|
-
if (fastAllowed) {
|
|
2558
|
-
while (match.length && typeof match[0] === 'string' && match[0].length === 1) {
|
|
2559
|
-
var word = match.shift();
|
|
2560
|
-
fast[word.charCodeAt(0)] = options;
|
|
2561
|
-
}
|
|
2562
|
-
}
|
|
2563
|
-
|
|
2564
|
-
// Warn about inappropriate state-switching options
|
|
2565
|
-
if (options.pop || options.push || options.next) {
|
|
2566
|
-
if (!hasStates) {
|
|
2567
|
-
throw new Error("State-switching options are not allowed in stateless lexers (for token '" + options.defaultType + "')")
|
|
2568
|
-
}
|
|
2569
|
-
if (options.fallback) {
|
|
2570
|
-
throw new Error("State-switching options are not allowed on fallback tokens (for token '" + options.defaultType + "')")
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
|
|
2574
|
-
// Only rules with a .match are included in the RegExp
|
|
2575
|
-
if (match.length === 0) {
|
|
2576
|
-
continue
|
|
2577
|
-
}
|
|
2578
|
-
fastAllowed = false;
|
|
2579
|
-
|
|
2580
|
-
groups.push(options);
|
|
2581
|
-
|
|
2582
|
-
// Check unicode flag is used everywhere or nowhere
|
|
2583
|
-
for (var j = 0; j < match.length; j++) {
|
|
2584
|
-
var obj = match[j];
|
|
2585
|
-
if (!isRegExp(obj)) {
|
|
2586
|
-
continue
|
|
2587
|
-
}
|
|
2588
|
-
|
|
2589
|
-
if (unicodeFlag === null) {
|
|
2590
|
-
unicodeFlag = obj.unicode;
|
|
2591
|
-
} else if (unicodeFlag !== obj.unicode && options.fallback === false) {
|
|
2592
|
-
throw new Error('If one rule is /u then all must be')
|
|
2593
|
-
}
|
|
2594
|
-
}
|
|
2595
|
-
|
|
2596
|
-
// convert to RegExp
|
|
2597
|
-
var pat = reUnion(match.map(regexpOrLiteral));
|
|
2598
|
-
|
|
2599
|
-
// validate
|
|
2600
|
-
var regexp = new RegExp(pat);
|
|
2601
|
-
if (regexp.test("")) {
|
|
2602
|
-
throw new Error("RegExp matches empty string: " + regexp)
|
|
2603
|
-
}
|
|
2604
|
-
var groupCount = reGroups(pat);
|
|
2605
|
-
if (groupCount > 0) {
|
|
2606
|
-
throw new Error("RegExp has capture groups: " + regexp + "\nUse (?: … ) instead")
|
|
2607
|
-
}
|
|
2608
|
-
|
|
2609
|
-
// try and detect rules matching newlines
|
|
2610
|
-
if (!options.lineBreaks && regexp.test('\n')) {
|
|
2611
|
-
throw new Error('Rule should declare lineBreaks: ' + regexp)
|
|
2612
|
-
}
|
|
2613
|
-
|
|
2614
|
-
// store regex
|
|
2615
|
-
parts.push(reCapture(pat));
|
|
2616
|
-
}
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
// If there's no fallback rule, use the sticky flag so we only look for
|
|
2620
|
-
// matches at the current index.
|
|
2621
|
-
//
|
|
2622
|
-
// If we don't support the sticky flag, then fake it using an irrefutable
|
|
2623
|
-
// match (i.e. an empty pattern).
|
|
2624
|
-
var fallbackRule = errorRule && errorRule.fallback;
|
|
2625
|
-
var flags = hasSticky && !fallbackRule ? 'ym' : 'gm';
|
|
2626
|
-
var suffix = hasSticky || fallbackRule ? '' : '|';
|
|
2627
|
-
|
|
2628
|
-
if (unicodeFlag === true) flags += "u";
|
|
2629
|
-
var combined = new RegExp(reUnion(parts) + suffix, flags);
|
|
2630
|
-
return {regexp: combined, groups: groups, fast: fast, error: errorRule || defaultErrorRule}
|
|
2631
|
-
}
|
|
2632
|
-
|
|
2633
|
-
function compile(rules) {
|
|
2634
|
-
var result = compileRules(toRules(rules));
|
|
2635
|
-
return new Lexer({start: result}, 'start')
|
|
2636
|
-
}
|
|
2637
|
-
|
|
2638
|
-
function checkStateGroup(g, name, map) {
|
|
2639
|
-
var state = g && (g.push || g.next);
|
|
2640
|
-
if (state && !map[state]) {
|
|
2641
|
-
throw new Error("Missing state '" + state + "' (in token '" + g.defaultType + "' of state '" + name + "')")
|
|
2642
|
-
}
|
|
2643
|
-
if (g && g.pop && +g.pop !== 1) {
|
|
2644
|
-
throw new Error("pop must be 1 (in token '" + g.defaultType + "' of state '" + name + "')")
|
|
2645
|
-
}
|
|
2646
|
-
}
|
|
2647
|
-
function compileStates(states, start) {
|
|
2648
|
-
var all = states.$all ? toRules(states.$all) : [];
|
|
2649
|
-
delete states.$all;
|
|
2650
|
-
|
|
2651
|
-
var keys = Object.getOwnPropertyNames(states);
|
|
2652
|
-
if (!start) start = keys[0];
|
|
2653
|
-
|
|
2654
|
-
var ruleMap = Object.create(null);
|
|
2655
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2656
|
-
var key = keys[i];
|
|
2657
|
-
ruleMap[key] = toRules(states[key]).concat(all);
|
|
2658
|
-
}
|
|
2659
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2660
|
-
var key = keys[i];
|
|
2661
|
-
var rules = ruleMap[key];
|
|
2662
|
-
var included = Object.create(null);
|
|
2663
|
-
for (var j = 0; j < rules.length; j++) {
|
|
2664
|
-
var rule = rules[j];
|
|
2665
|
-
if (!rule.include) continue
|
|
2666
|
-
var splice = [j, 1];
|
|
2667
|
-
if (rule.include !== key && !included[rule.include]) {
|
|
2668
|
-
included[rule.include] = true;
|
|
2669
|
-
var newRules = ruleMap[rule.include];
|
|
2670
|
-
if (!newRules) {
|
|
2671
|
-
throw new Error("Cannot include nonexistent state '" + rule.include + "' (in state '" + key + "')")
|
|
2672
|
-
}
|
|
2673
|
-
for (var k = 0; k < newRules.length; k++) {
|
|
2674
|
-
var newRule = newRules[k];
|
|
2675
|
-
if (rules.indexOf(newRule) !== -1) continue
|
|
2676
|
-
splice.push(newRule);
|
|
2677
|
-
}
|
|
2678
|
-
}
|
|
2679
|
-
rules.splice.apply(rules, splice);
|
|
2680
|
-
j--;
|
|
2681
|
-
}
|
|
2682
|
-
}
|
|
2683
|
-
|
|
2684
|
-
var map = Object.create(null);
|
|
2685
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2686
|
-
var key = keys[i];
|
|
2687
|
-
map[key] = compileRules(ruleMap[key], true);
|
|
2688
|
-
}
|
|
2689
|
-
|
|
2690
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2691
|
-
var name = keys[i];
|
|
2692
|
-
var state = map[name];
|
|
2693
|
-
var groups = state.groups;
|
|
2694
|
-
for (var j = 0; j < groups.length; j++) {
|
|
2695
|
-
checkStateGroup(groups[j], name, map);
|
|
2696
|
-
}
|
|
2697
|
-
var fastKeys = Object.getOwnPropertyNames(state.fast);
|
|
2698
|
-
for (var j = 0; j < fastKeys.length; j++) {
|
|
2699
|
-
checkStateGroup(state.fast[fastKeys[j]], name, map);
|
|
2700
|
-
}
|
|
2701
|
-
}
|
|
2702
|
-
|
|
2703
|
-
return new Lexer(map, start)
|
|
2704
|
-
}
|
|
2705
|
-
|
|
2706
|
-
function keywordTransform(map) {
|
|
2707
|
-
var reverseMap = Object.create(null);
|
|
2708
|
-
var byLength = Object.create(null);
|
|
2709
|
-
var types = Object.getOwnPropertyNames(map);
|
|
2710
|
-
for (var i = 0; i < types.length; i++) {
|
|
2711
|
-
var tokenType = types[i];
|
|
2712
|
-
var item = map[tokenType];
|
|
2713
|
-
var keywordList = Array.isArray(item) ? item : [item];
|
|
2714
|
-
keywordList.forEach(function(keyword) {
|
|
2715
|
-
(byLength[keyword.length] = byLength[keyword.length] || []).push(keyword);
|
|
2716
|
-
if (typeof keyword !== 'string') {
|
|
2717
|
-
throw new Error("keyword must be string (in keyword '" + tokenType + "')")
|
|
2718
|
-
}
|
|
2719
|
-
reverseMap[keyword] = tokenType;
|
|
2720
|
-
});
|
|
2721
|
-
}
|
|
2722
|
-
|
|
2723
|
-
// fast string lookup
|
|
2724
|
-
// https://jsperf.com/string-lookups
|
|
2725
|
-
function str(x) { return JSON.stringify(x) }
|
|
2726
|
-
var source = '';
|
|
2727
|
-
source += 'switch (value.length) {\n';
|
|
2728
|
-
for (var length in byLength) {
|
|
2729
|
-
var keywords = byLength[length];
|
|
2730
|
-
source += 'case ' + length + ':\n';
|
|
2731
|
-
source += 'switch (value) {\n';
|
|
2732
|
-
keywords.forEach(function(keyword) {
|
|
2733
|
-
var tokenType = reverseMap[keyword];
|
|
2734
|
-
source += 'case ' + str(keyword) + ': return ' + str(tokenType) + '\n';
|
|
2735
|
-
});
|
|
2736
|
-
source += '}\n';
|
|
2737
|
-
}
|
|
2738
|
-
source += '}\n';
|
|
2739
|
-
return Function('value', source) // type
|
|
2740
|
-
}
|
|
2741
|
-
|
|
2742
|
-
/***************************************************************************/
|
|
2743
|
-
|
|
2744
|
-
var Lexer = function(states, state) {
|
|
2745
|
-
this.startState = state;
|
|
2746
|
-
this.states = states;
|
|
2747
|
-
this.buffer = '';
|
|
2748
|
-
this.stack = [];
|
|
2749
|
-
this.reset();
|
|
2750
|
-
};
|
|
2751
|
-
|
|
2752
|
-
Lexer.prototype.reset = function(data, info) {
|
|
2753
|
-
this.buffer = data || '';
|
|
2754
|
-
this.index = 0;
|
|
2755
|
-
this.line = info ? info.line : 1;
|
|
2756
|
-
this.col = info ? info.col : 1;
|
|
2757
|
-
this.queuedToken = info ? info.queuedToken : null;
|
|
2758
|
-
this.queuedThrow = info ? info.queuedThrow : null;
|
|
2759
|
-
this.setState(info ? info.state : this.startState);
|
|
2760
|
-
this.stack = info && info.stack ? info.stack.slice() : [];
|
|
2761
|
-
return this
|
|
2762
|
-
};
|
|
2763
|
-
|
|
2764
|
-
Lexer.prototype.save = function() {
|
|
2765
|
-
return {
|
|
2766
|
-
line: this.line,
|
|
2767
|
-
col: this.col,
|
|
2768
|
-
state: this.state,
|
|
2769
|
-
stack: this.stack.slice(),
|
|
2770
|
-
queuedToken: this.queuedToken,
|
|
2771
|
-
queuedThrow: this.queuedThrow,
|
|
2772
|
-
}
|
|
2773
|
-
};
|
|
2774
|
-
|
|
2775
|
-
Lexer.prototype.setState = function(state) {
|
|
2776
|
-
if (!state || this.state === state) return
|
|
2777
|
-
this.state = state;
|
|
2778
|
-
var info = this.states[state];
|
|
2779
|
-
this.groups = info.groups;
|
|
2780
|
-
this.error = info.error;
|
|
2781
|
-
this.re = info.regexp;
|
|
2782
|
-
this.fast = info.fast;
|
|
2783
|
-
};
|
|
2784
|
-
|
|
2785
|
-
Lexer.prototype.popState = function() {
|
|
2786
|
-
this.setState(this.stack.pop());
|
|
2787
|
-
};
|
|
2788
|
-
|
|
2789
|
-
Lexer.prototype.pushState = function(state) {
|
|
2790
|
-
this.stack.push(this.state);
|
|
2791
|
-
this.setState(state);
|
|
2792
|
-
};
|
|
2793
|
-
|
|
2794
|
-
var eat = hasSticky ? function(re, buffer) { // assume re is /y
|
|
2795
|
-
return re.exec(buffer)
|
|
2796
|
-
} : function(re, buffer) { // assume re is /g
|
|
2797
|
-
var match = re.exec(buffer);
|
|
2798
|
-
// will always match, since we used the |(?:) trick
|
|
2799
|
-
if (match[0].length === 0) {
|
|
2800
|
-
return null
|
|
2801
|
-
}
|
|
2802
|
-
return match
|
|
2803
|
-
};
|
|
2804
|
-
|
|
2805
|
-
Lexer.prototype._getGroup = function(match) {
|
|
2806
|
-
var groupCount = this.groups.length;
|
|
2807
|
-
for (var i = 0; i < groupCount; i++) {
|
|
2808
|
-
if (match[i + 1] !== undefined) {
|
|
2809
|
-
return this.groups[i]
|
|
2810
|
-
}
|
|
2811
|
-
}
|
|
2812
|
-
throw new Error('Cannot find token type for matched text')
|
|
2813
|
-
};
|
|
2814
|
-
|
|
2815
|
-
function tokenToString() {
|
|
2816
|
-
return this.value
|
|
2817
|
-
}
|
|
2158
|
+
const curry$7 = justCurryIt;
|
|
2818
2159
|
|
|
2819
|
-
Lexer.prototype.next = function() {
|
|
2820
|
-
var index = this.index;
|
|
2821
2160
|
|
|
2822
|
-
|
|
2823
|
-
if (this.queuedGroup) {
|
|
2824
|
-
var token = this._token(this.queuedGroup, this.queuedText, index);
|
|
2825
|
-
this.queuedGroup = null;
|
|
2826
|
-
this.queuedText = "";
|
|
2827
|
-
return token
|
|
2828
|
-
}
|
|
2829
|
-
|
|
2830
|
-
var buffer = this.buffer;
|
|
2831
|
-
if (index === buffer.length) {
|
|
2832
|
-
return // EOF
|
|
2833
|
-
}
|
|
2834
|
-
|
|
2835
|
-
// Fast matching for single characters
|
|
2836
|
-
var group = this.fast[buffer.charCodeAt(index)];
|
|
2837
|
-
if (group) {
|
|
2838
|
-
return this._token(group, buffer.charAt(index), index)
|
|
2839
|
-
}
|
|
2840
|
-
|
|
2841
|
-
// Execute RegExp
|
|
2842
|
-
var re = this.re;
|
|
2843
|
-
re.lastIndex = index;
|
|
2844
|
-
var match = eat(re, buffer);
|
|
2845
|
-
|
|
2846
|
-
// Error tokens match the remaining buffer
|
|
2847
|
-
var error = this.error;
|
|
2848
|
-
if (match == null) {
|
|
2849
|
-
return this._token(error, buffer.slice(index, buffer.length), index)
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
var group = this._getGroup(match);
|
|
2853
|
-
var text = match[0];
|
|
2854
|
-
|
|
2855
|
-
if (error.fallback && match.index !== index) {
|
|
2856
|
-
this.queuedGroup = group;
|
|
2857
|
-
this.queuedText = text;
|
|
2858
|
-
|
|
2859
|
-
// Fallback tokens contain the unmatched portion of the buffer
|
|
2860
|
-
return this._token(error, buffer.slice(index, match.index), index)
|
|
2861
|
-
}
|
|
2862
|
-
|
|
2863
|
-
return this._token(group, text, index)
|
|
2864
|
-
};
|
|
2865
|
-
|
|
2866
|
-
Lexer.prototype._token = function(group, text, offset) {
|
|
2867
|
-
// count line breaks
|
|
2868
|
-
var lineBreaks = 0;
|
|
2869
|
-
if (group.lineBreaks) {
|
|
2870
|
-
var matchNL = /\n/g;
|
|
2871
|
-
var nl = 1;
|
|
2872
|
-
if (text === '\n') {
|
|
2873
|
-
lineBreaks = 1;
|
|
2874
|
-
} else {
|
|
2875
|
-
while (matchNL.exec(text)) { lineBreaks++; nl = matchNL.lastIndex; }
|
|
2876
|
-
}
|
|
2877
|
-
}
|
|
2878
|
-
|
|
2879
|
-
var token = {
|
|
2880
|
-
type: (typeof group.type === 'function' && group.type(text)) || group.defaultType,
|
|
2881
|
-
value: typeof group.value === 'function' ? group.value(text) : text,
|
|
2882
|
-
text: text,
|
|
2883
|
-
toString: tokenToString,
|
|
2884
|
-
offset: offset,
|
|
2885
|
-
lineBreaks: lineBreaks,
|
|
2886
|
-
line: this.line,
|
|
2887
|
-
col: this.col,
|
|
2888
|
-
};
|
|
2889
|
-
// nb. adding more props to token object will make V8 sad!
|
|
2890
|
-
|
|
2891
|
-
var size = text.length;
|
|
2892
|
-
this.index += size;
|
|
2893
|
-
this.line += lineBreaks;
|
|
2894
|
-
if (lineBreaks !== 0) {
|
|
2895
|
-
this.col = size - nl + 1;
|
|
2896
|
-
} else {
|
|
2897
|
-
this.col += size;
|
|
2898
|
-
}
|
|
2899
|
-
|
|
2900
|
-
// throw, if no rule with {error: true}
|
|
2901
|
-
if (group.shouldThrow) {
|
|
2902
|
-
throw new Error(this.formatError(token, "invalid syntax"))
|
|
2903
|
-
}
|
|
2904
|
-
|
|
2905
|
-
if (group.pop) this.popState();
|
|
2906
|
-
else if (group.push) this.pushState(group.push);
|
|
2907
|
-
else if (group.next) this.setState(group.next);
|
|
2908
|
-
|
|
2909
|
-
return token
|
|
2910
|
-
};
|
|
2911
|
-
|
|
2912
|
-
if (typeof Symbol !== 'undefined' && Symbol.iterator) {
|
|
2913
|
-
var LexerIterator = function(lexer) {
|
|
2914
|
-
this.lexer = lexer;
|
|
2915
|
-
};
|
|
2916
|
-
|
|
2917
|
-
LexerIterator.prototype.next = function() {
|
|
2918
|
-
var token = this.lexer.next();
|
|
2919
|
-
return {value: token, done: !token}
|
|
2920
|
-
};
|
|
2921
|
-
|
|
2922
|
-
LexerIterator.prototype[Symbol.iterator] = function() {
|
|
2923
|
-
return this
|
|
2924
|
-
};
|
|
2925
|
-
|
|
2926
|
-
Lexer.prototype[Symbol.iterator] = function() {
|
|
2927
|
-
return new LexerIterator(this)
|
|
2928
|
-
};
|
|
2929
|
-
}
|
|
2930
|
-
|
|
2931
|
-
Lexer.prototype.formatError = function(token, message) {
|
|
2932
|
-
if (token == null) {
|
|
2933
|
-
// An undefined token indicates EOF
|
|
2934
|
-
var text = this.buffer.slice(this.index);
|
|
2935
|
-
var token = {
|
|
2936
|
-
text: text,
|
|
2937
|
-
offset: this.index,
|
|
2938
|
-
lineBreaks: text.indexOf('\n') === -1 ? 0 : 1,
|
|
2939
|
-
line: this.line,
|
|
2940
|
-
col: this.col,
|
|
2941
|
-
};
|
|
2942
|
-
}
|
|
2943
|
-
var start = Math.max(0, token.offset - token.col + 1);
|
|
2944
|
-
var eol = token.lineBreaks ? token.text.indexOf('\n') : token.text.length;
|
|
2945
|
-
var firstLine = this.buffer.substring(start, token.offset + eol);
|
|
2946
|
-
message += " at line " + token.line + " col " + token.col + ":\n\n";
|
|
2947
|
-
message += " " + firstLine + "\n";
|
|
2948
|
-
message += " " + Array(token.col).join(" ") + "^";
|
|
2949
|
-
return message
|
|
2950
|
-
};
|
|
2951
|
-
|
|
2952
|
-
Lexer.prototype.clone = function() {
|
|
2953
|
-
return new Lexer(this.states, this.state)
|
|
2954
|
-
};
|
|
2955
|
-
|
|
2956
|
-
Lexer.prototype.has = function(tokenType) {
|
|
2957
|
-
return true
|
|
2958
|
-
};
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
return {
|
|
2962
|
-
compile: compile,
|
|
2963
|
-
states: compileStates,
|
|
2964
|
-
error: Object.freeze({error: true}),
|
|
2965
|
-
fallback: Object.freeze({fallback: true}),
|
|
2966
|
-
keywords: keywordTransform,
|
|
2967
|
-
}
|
|
2968
|
-
|
|
2969
|
-
}));
|
|
2970
|
-
} (moo$1));
|
|
2971
|
-
|
|
2972
|
-
const moo = moo$1.exports;
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
const digit = `[0-9]`;
|
|
2976
|
-
const digit19 = `[1-9]`;
|
|
2977
|
-
const hexdig = `[0-9a-fA-F]`;
|
|
2978
|
-
|
|
2979
|
-
// String
|
|
2980
|
-
const unescaped = `[\\x20-\\x21\\x23-\\x5b\\x5d-\\u{10ffff}]`;
|
|
2981
|
-
const escape = `\\\\`;
|
|
2982
|
-
const escaped = `${escape}(?:["\\/\\\\brfnt]|u${hexdig}{4})`;
|
|
2983
|
-
const char = `(?:${unescaped}|${escaped})`;
|
|
2984
|
-
const string = `"${char}*"`;
|
|
2985
|
-
|
|
2986
|
-
// Number
|
|
2987
|
-
const int = `(?:0|${digit19}${digit}*)`;
|
|
2988
|
-
const frac = `\\.${digit}+`;
|
|
2989
|
-
const e = `[eE]`;
|
|
2990
|
-
const exp = `${e}[-+]?${digit}+`;
|
|
2991
|
-
const number = `-?${int}(?:${frac})?(?:${exp})?`;
|
|
2992
|
-
|
|
2993
|
-
// Whitespace
|
|
2994
|
-
const whitespace = `(?:(?:\\r?\\n)|[ \\t])+`;
|
|
2995
|
-
|
|
2996
|
-
var lexer = (json) => {
|
|
2997
|
-
const lexer = moo.states({
|
|
2998
|
-
main: {
|
|
2999
|
-
WS: { match: new RegExp(whitespace, "u"), lineBreaks: true },
|
|
3000
|
-
true: { match: "true", value: () => true },
|
|
3001
|
-
false: { match: "false", value: () => false },
|
|
3002
|
-
null: { match: "null", value: () => null },
|
|
3003
|
-
number: { match: new RegExp(number, "u"), value: parseFloat },
|
|
3004
|
-
string: { match: new RegExp(string, "u"), value: JSON.parse },
|
|
3005
|
-
"{": "{",
|
|
3006
|
-
"}": "}",
|
|
3007
|
-
"[": "[",
|
|
3008
|
-
"]": "]",
|
|
3009
|
-
":": ":",
|
|
3010
|
-
",": ",",
|
|
3011
|
-
error: moo.error
|
|
3012
|
-
}
|
|
3013
|
-
});
|
|
3014
|
-
lexer.reset(json);
|
|
3015
|
-
|
|
3016
|
-
const _next = () => {
|
|
3017
|
-
let token;
|
|
3018
|
-
do {
|
|
3019
|
-
token = lexer.next();
|
|
3020
|
-
if (token?.type === "error") {
|
|
3021
|
-
throw SyntaxError(lexer.formatError(token, "Unrecognized token"));
|
|
3022
|
-
}
|
|
3023
|
-
} while (token?.type === "WS");
|
|
3024
|
-
|
|
3025
|
-
return token;
|
|
3026
|
-
};
|
|
3027
|
-
|
|
3028
|
-
let previous;
|
|
3029
|
-
let nextToken = _next();
|
|
3030
|
-
|
|
3031
|
-
const next = (expectedType = undefined) => {
|
|
3032
|
-
previous = nextToken;
|
|
3033
|
-
nextToken = _next();
|
|
3034
|
-
if (expectedType && previous?.type !== expectedType) {
|
|
3035
|
-
throw SyntaxError(lexer.formatError(previous, `Expected a '${expectedType}'`));
|
|
3036
|
-
}
|
|
3037
|
-
return previous;
|
|
3038
|
-
};
|
|
3039
|
-
|
|
3040
|
-
const peek = () => nextToken;
|
|
3041
|
-
|
|
3042
|
-
const defaultErrorToken = { offset: 0, line: 1, col: 0, text: "" };
|
|
3043
|
-
const syntaxError = (message) => {
|
|
3044
|
-
const referenceToken = previous || defaultErrorToken;
|
|
3045
|
-
const errorToken = {
|
|
3046
|
-
...referenceToken,
|
|
3047
|
-
offset: referenceToken.offset + referenceToken.text.length,
|
|
3048
|
-
col: referenceToken.col + referenceToken.text.length
|
|
3049
|
-
};
|
|
3050
|
-
throw new SyntaxError(lexer.formatError(errorToken, message));
|
|
3051
|
-
};
|
|
3052
|
-
|
|
3053
|
-
return { next, peek, syntaxError };
|
|
3054
|
-
};
|
|
3055
|
-
|
|
3056
|
-
const JsonPointer$2 = lib$4;
|
|
3057
|
-
const jsonLexer = lexer;
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
const defaultReviver = (key, value) => value;
|
|
3061
|
-
const parse$3 = (json, reviver = defaultReviver) => {
|
|
3062
|
-
const lexer = jsonLexer(json);
|
|
3063
|
-
const value = parseValue(lexer, "", JsonPointer$2.nil, reviver);
|
|
3064
|
-
|
|
3065
|
-
const token = lexer.peek();
|
|
3066
|
-
if (token) {
|
|
3067
|
-
lexer.syntaxError("A value has been parsed, but more tokens were found");
|
|
3068
|
-
}
|
|
3069
|
-
return value;
|
|
3070
|
-
};
|
|
3071
|
-
|
|
3072
|
-
const parseValue = (lexer, key, pointer, reviver) => {
|
|
3073
|
-
let value;
|
|
3074
|
-
const token = lexer.next();
|
|
3075
|
-
switch (token?.type) {
|
|
3076
|
-
case "true":
|
|
3077
|
-
case "false":
|
|
3078
|
-
case "null":
|
|
3079
|
-
case "number":
|
|
3080
|
-
case "string":
|
|
3081
|
-
value = token.value;
|
|
3082
|
-
break;
|
|
3083
|
-
case "{":
|
|
3084
|
-
value = parseObject(lexer, key, pointer, reviver);
|
|
3085
|
-
break;
|
|
3086
|
-
case "[":
|
|
3087
|
-
value = parseArray(lexer, key, pointer, reviver);
|
|
3088
|
-
break;
|
|
3089
|
-
default:
|
|
3090
|
-
lexer.syntaxError("Expected a JSON value");
|
|
3091
|
-
}
|
|
3092
|
-
|
|
3093
|
-
return reviver(key, value, pointer);
|
|
3094
|
-
};
|
|
3095
|
-
|
|
3096
|
-
const parseObject = (lexer, key, pointer, reviver) => {
|
|
3097
|
-
const value = {};
|
|
3098
|
-
|
|
3099
|
-
if (lexer.peek()?.type !== "}") {
|
|
3100
|
-
parseProperties(lexer, key, pointer, reviver, value);
|
|
3101
|
-
}
|
|
3102
|
-
|
|
3103
|
-
lexer.next("}");
|
|
2161
|
+
var map$3 = curry$7(async (fn, doc) => (await doc).map(fn));
|
|
3104
2162
|
|
|
3105
|
-
|
|
3106
|
-
};
|
|
2163
|
+
const curry$6 = justCurryIt;
|
|
3107
2164
|
|
|
3108
|
-
const parseProperties = (lexer, key, pointer, reviver, value) => {
|
|
3109
|
-
const propertyName = lexer.next("string").value;
|
|
3110
|
-
lexer.next(":");
|
|
3111
|
-
if (!isValueToken(lexer.peek())) {
|
|
3112
|
-
lexer.syntaxError("Expected a JSON value");
|
|
3113
|
-
}
|
|
3114
|
-
value[propertyName] = parseValue(lexer, propertyName, JsonPointer$2.append(propertyName, pointer), reviver);
|
|
3115
2165
|
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
} else if (isValueToken(lexer.peek())) {
|
|
3120
|
-
lexer.next(",");
|
|
3121
|
-
}
|
|
3122
|
-
};
|
|
2166
|
+
var reduce$2 = curry$6(async (fn, acc, doc) => {
|
|
2167
|
+
return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
|
|
2168
|
+
});
|
|
3123
2169
|
|
|
3124
|
-
const
|
|
3125
|
-
|
|
2170
|
+
const curry$5 = justCurryIt;
|
|
2171
|
+
const reduce$1 = reduce$2;
|
|
3126
2172
|
|
|
3127
|
-
if (lexer.peek()?.type !== "]") {
|
|
3128
|
-
parseItems(lexer, 0, pointer, reviver, value);
|
|
3129
|
-
}
|
|
3130
2173
|
|
|
3131
|
-
|
|
2174
|
+
var filter = curry$5(async (fn, doc, options = {}) => {
|
|
2175
|
+
return reduce$1(async (acc, item) => {
|
|
2176
|
+
return (await fn(item)) ? acc.concat([item]) : acc;
|
|
2177
|
+
}, [], doc, options);
|
|
2178
|
+
});
|
|
3132
2179
|
|
|
3133
|
-
|
|
3134
|
-
|
|
2180
|
+
const curry$4 = justCurryIt;
|
|
2181
|
+
const map$2 = map$3;
|
|
3135
2182
|
|
|
3136
|
-
const parseItems = (lexer, key, pointer, reviver, value) => {
|
|
3137
|
-
if (!isValueToken(lexer.peek())) {
|
|
3138
|
-
lexer.syntaxError("Expected a JSON value");
|
|
3139
|
-
}
|
|
3140
|
-
value[key] = parseValue(lexer, key, JsonPointer$2.append(key, pointer), reviver);
|
|
3141
|
-
if (lexer.peek()?.type === ",") {
|
|
3142
|
-
lexer.next(); // burn comma
|
|
3143
|
-
parseItems(lexer, key + 1, pointer, reviver, value);
|
|
3144
|
-
} else if (isValueToken(lexer.peek())) {
|
|
3145
|
-
lexer.next(",");
|
|
3146
|
-
}
|
|
3147
|
-
};
|
|
3148
2183
|
|
|
3149
|
-
|
|
3150
|
-
|
|
2184
|
+
var some = curry$4(async (fn, doc) => {
|
|
2185
|
+
const results = await map$2(fn, doc);
|
|
2186
|
+
return (await Promise.all(results))
|
|
2187
|
+
.some((a) => a);
|
|
2188
|
+
});
|
|
3151
2189
|
|
|
3152
|
-
|
|
2190
|
+
const curry$3 = justCurryIt;
|
|
2191
|
+
const map$1 = map$3;
|
|
3153
2192
|
|
|
3154
|
-
const JsonPointer$1 = lib$4;
|
|
3155
2193
|
|
|
2194
|
+
var every = curry$3(async (fn, doc) => {
|
|
2195
|
+
const results = await map$1(fn, doc);
|
|
2196
|
+
return (await Promise.all(results))
|
|
2197
|
+
.every((a) => a);
|
|
2198
|
+
});
|
|
3156
2199
|
|
|
3157
|
-
const
|
|
3158
|
-
const stringify$2 = (value, replacer = defaultReplacer, space = "") => {
|
|
3159
|
-
return stringifyValue(value, replacer, space, "", JsonPointer$1.nil, 1);
|
|
3160
|
-
};
|
|
2200
|
+
const curry$2 = justCurryIt;
|
|
3161
2201
|
|
|
3162
|
-
const stringifyValue = (value, replacer, space, key, pointer, depth) => {
|
|
3163
|
-
value = replacer(key, value, pointer);
|
|
3164
|
-
let result;
|
|
3165
|
-
if (Array.isArray(value)) {
|
|
3166
|
-
result = stringifyArray(value, replacer, space, pointer, depth);
|
|
3167
|
-
} else if (typeof value === "object" && value !== null) {
|
|
3168
|
-
result = stringifyObject(value, replacer, space, pointer, depth);
|
|
3169
|
-
} else {
|
|
3170
|
-
result = JSON.stringify(value);
|
|
3171
|
-
}
|
|
3172
2202
|
|
|
3173
|
-
|
|
3174
|
-
|
|
2203
|
+
var pipeline$1 = curry$2((fns, doc) => {
|
|
2204
|
+
return fns.reduce(async (acc, fn) => fn(await acc), doc);
|
|
2205
|
+
});
|
|
3175
2206
|
|
|
3176
|
-
|
|
3177
|
-
if (value.length === 0) {
|
|
3178
|
-
space = "";
|
|
3179
|
-
}
|
|
3180
|
-
const padding = space ? `\n${space.repeat(depth - 1)}` : "";
|
|
3181
|
-
return "[" + padding + space + value
|
|
3182
|
-
.map((item, index) => {
|
|
3183
|
-
const indexPointer = JsonPointer$1.append(index, pointer);
|
|
3184
|
-
return stringifyValue(item, replacer, space, index, indexPointer, depth + 1);
|
|
3185
|
-
})
|
|
3186
|
-
.join(`,${padding}${space}`) + padding + "]";
|
|
3187
|
-
};
|
|
3188
|
-
|
|
3189
|
-
const stringifyObject = (value, replacer, space, pointer, depth) => {
|
|
3190
|
-
if (Object.keys(value).length === 0) {
|
|
3191
|
-
space = "";
|
|
3192
|
-
}
|
|
3193
|
-
const padding = space ? `\n${space.repeat(depth - 1)}` : "";
|
|
3194
|
-
const spacing = space ? " " : "";
|
|
3195
|
-
return "{" + padding + space + Object.entries(value)
|
|
3196
|
-
.map(([key, value]) => {
|
|
3197
|
-
const keyPointer = JsonPointer$1.append(key, pointer);
|
|
3198
|
-
return JSON.stringify(key) + ":" + spacing + stringifyValue(value, replacer, space, key, keyPointer, depth + 1);
|
|
3199
|
-
})
|
|
3200
|
-
.join(`,${padding}${space}`) + padding + "}";
|
|
3201
|
-
};
|
|
2207
|
+
var all = (doc) => Promise.all(doc);
|
|
3202
2208
|
|
|
3203
|
-
|
|
2209
|
+
const pipeline = pipeline$1;
|
|
2210
|
+
const entries$1 = entries$2;
|
|
2211
|
+
const reduce = reduce$2;
|
|
3204
2212
|
|
|
3205
|
-
const parse$2 = parse_1;
|
|
3206
|
-
const stringify$1 = stringify_1;
|
|
3207
2213
|
|
|
2214
|
+
var allValues = (doc) => {
|
|
2215
|
+
return pipeline([
|
|
2216
|
+
entries$1,
|
|
2217
|
+
reduce(async (acc, [propertyName, propertyValue]) => {
|
|
2218
|
+
acc[propertyName] = await propertyValue;
|
|
2219
|
+
return acc;
|
|
2220
|
+
}, {})
|
|
2221
|
+
], doc);
|
|
2222
|
+
};
|
|
3208
2223
|
|
|
3209
|
-
var lib$
|
|
2224
|
+
var lib$2 = {
|
|
2225
|
+
entries: entries$2,
|
|
2226
|
+
map: map$3,
|
|
2227
|
+
filter: filter,
|
|
2228
|
+
reduce: reduce$2,
|
|
2229
|
+
some: some,
|
|
2230
|
+
every: every,
|
|
2231
|
+
pipeline: pipeline$1,
|
|
2232
|
+
all: all,
|
|
2233
|
+
allValues: allValues
|
|
2234
|
+
};
|
|
3210
2235
|
|
|
3211
2236
|
var fetch_browser = fetch;
|
|
3212
2237
|
|
|
@@ -3462,10 +2487,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3462
2487
|
|
|
3463
2488
|
var mediaTypes = { addPlugin, parse, getContentType };
|
|
3464
2489
|
|
|
3465
|
-
const curry$
|
|
3466
|
-
const Pact$a = lib$
|
|
3467
|
-
const
|
|
3468
|
-
const JsonPointer = lib$6;
|
|
2490
|
+
const curry$1 = justCurryIt$1;
|
|
2491
|
+
const Pact$a = lib$2;
|
|
2492
|
+
const JsonPointer = lib$3;
|
|
3469
2493
|
const { jsonTypeOf, resolveUrl: resolveUrl$1, urlFragment, pathRelative } = common$1;
|
|
3470
2494
|
const fetch$1 = fetch_browser;
|
|
3471
2495
|
const Reference$1 = reference;
|
|
@@ -3496,61 +2520,64 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3496
2520
|
// Schema Management
|
|
3497
2521
|
const schemaStore = {};
|
|
3498
2522
|
const schemaStoreAlias = {};
|
|
3499
|
-
const add$1 = (schema, retrievalUri = "", defaultDialectId = "") => {
|
|
3500
|
-
const dialectId = getDialectId(schema, retrievalUri, defaultDialectId);
|
|
3501
|
-
|
|
3502
|
-
const id = getBaseUri(schema, retrievalUri, dialectJsonSchemaVersion[dialectId]);
|
|
3503
|
-
|
|
3504
|
-
// Extract embedded schemas and collect anchors
|
|
3505
|
-
const embeddedToken = getConfig(dialectId, "embeddedToken");
|
|
3506
|
-
const baseToken = getConfig(dialectId, "baseToken");
|
|
3507
|
-
const anchorToken = getConfig(dialectId, "anchorToken");
|
|
3508
|
-
const dynamicAnchorToken = getConfig(dialectId, "dynamicAnchorToken");
|
|
3509
|
-
const jrefToken = getConfig(dialectId, "jrefToken");
|
|
3510
|
-
|
|
3511
|
-
const dynamicAnchors = {};
|
|
3512
|
-
const anchors = { "": "" };
|
|
3513
|
-
|
|
3514
|
-
schema = Json.parse(JSON.stringify(schema), (key, value, pointer) => {
|
|
3515
|
-
if (jsonTypeOf(value, "object")) {
|
|
3516
|
-
// Embedded Schema
|
|
3517
|
-
const embeddedSchemaDialectId = typeof value.$schema === "string" ? resolveUrl$1(value.$schema, "") : dialectId;
|
|
3518
|
-
const embeddedEmbeddedToken = getConfig(embeddedSchemaDialectId, "embeddedToken");
|
|
3519
|
-
const embeddedAnchorToken = getConfig(embeddedSchemaDialectId, "anchorToken");
|
|
3520
|
-
if (typeof value[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || value[embeddedEmbeddedToken][0] !== "#") && pointer !== "") {
|
|
3521
|
-
const embeddedRetrievalUri = resolveUrl$1(id, value[embeddedEmbeddedToken]);
|
|
3522
|
-
add$1(value, embeddedRetrievalUri, dialectId);
|
|
3523
|
-
return Reference$1.cons(value[embeddedEmbeddedToken], value);
|
|
3524
|
-
}
|
|
3525
2523
|
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
2524
|
+
const add$1 = (schema, url = "", defaultSchemaVersion = "") => {
|
|
2525
|
+
schema = JSON.parse(JSON.stringify(schema));
|
|
2526
|
+
const externalId = resolveUrl$1(url, "");
|
|
3529
2527
|
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
2528
|
+
// Dialect / JSON Schema Version
|
|
2529
|
+
const dialectId = resolveUrl$1(schema["$schema"] || defaultSchemaVersion, "");
|
|
2530
|
+
if (!dialectId) {
|
|
2531
|
+
throw Error("Couldn't determine schema dialect");
|
|
2532
|
+
}
|
|
2533
|
+
delete schema["$schema"];
|
|
3535
2534
|
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
2535
|
+
// Determine JSON Schema version
|
|
2536
|
+
if (!(dialectId in dialectJsonSchemaVersion)) {
|
|
2537
|
+
if (schema?.$vocabulary?.[core201909Id] === true && dialectId === getSchemaIdentifier(schema, externalId, core201909Id)[0]) {
|
|
2538
|
+
// Self describing 2019-09 meta-schema
|
|
2539
|
+
dialectJsonSchemaVersion[dialectId] = core201909Id;
|
|
2540
|
+
} else if (schema?.$vocabulary?.[core202012Id] === true && dialectId === getSchemaIdentifier(schema, externalId, core202012Id)[0]) {
|
|
2541
|
+
// Self describing 2020-12 meta-schema
|
|
2542
|
+
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
2543
|
+
} else {
|
|
2544
|
+
// Need to look at meta-schema to determine version
|
|
2545
|
+
const metaSchema = schemaStore[dialectId];
|
|
2546
|
+
if (!metaSchema) {
|
|
2547
|
+
throw Error(`Couldn't determine JSON Schema version for dialect: '${dialectId}'`);
|
|
2548
|
+
} else if (metaSchema.vocabulary[core201909Id] === true) {
|
|
2549
|
+
dialectJsonSchemaVersion[dialectId] = core201909Id;
|
|
2550
|
+
} else if (metaSchema.vocabulary[core202012Id] === true) {
|
|
2551
|
+
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
2552
|
+
} else {
|
|
2553
|
+
// Assume the jsonSchemaVersion is the meta-schema's dialectId (non-standard behavior)
|
|
2554
|
+
dialectJsonSchemaVersion[dialectId] = dialectJsonSchemaVersion[metaSchema.dialectId];
|
|
3540
2555
|
}
|
|
3541
2556
|
}
|
|
2557
|
+
}
|
|
3542
2558
|
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
2559
|
+
// Internal Identifier
|
|
2560
|
+
const [id, fragment] = getSchemaIdentifier(schema, externalId, dialectJsonSchemaVersion[dialectId]);
|
|
2561
|
+
if (!id) {
|
|
2562
|
+
throw Error("Couldn't determine an identifier for the schema");
|
|
2563
|
+
}
|
|
2564
|
+
const baseToken = getConfig(dialectId, "baseToken");
|
|
3548
2565
|
delete schema[baseToken];
|
|
2566
|
+
if (externalId) {
|
|
2567
|
+
schemaStoreAlias[externalId] = id;
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
const anchorToken = getConfig(dialectId, "anchorToken");
|
|
2571
|
+
if (fragment && baseToken === anchorToken) {
|
|
2572
|
+
schema[anchorToken] = anchorToken !== baseToken ? encodeURI(fragment) : `#${encodeURI(fragment)}`;
|
|
2573
|
+
}
|
|
3549
2574
|
|
|
3550
2575
|
// recursiveAnchor
|
|
2576
|
+
const dynamicAnchors = {};
|
|
3551
2577
|
const recursiveAnchorToken = getConfig(dialectId, "recursiveAnchorToken");
|
|
3552
2578
|
if (schema[recursiveAnchorToken] === true) {
|
|
3553
2579
|
dynamicAnchors[""] = `${id}#`;
|
|
2580
|
+
schema[anchorToken] = "";
|
|
3554
2581
|
delete schema[recursiveAnchorToken];
|
|
3555
2582
|
}
|
|
3556
2583
|
|
|
@@ -3565,66 +2592,69 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3565
2592
|
}
|
|
3566
2593
|
|
|
3567
2594
|
// Store Schema
|
|
2595
|
+
const anchors = { "": "" };
|
|
3568
2596
|
schemaStore[id] = {
|
|
3569
|
-
id,
|
|
3570
|
-
dialectId,
|
|
3571
|
-
schema,
|
|
3572
|
-
anchors,
|
|
3573
|
-
dynamicAnchors,
|
|
3574
|
-
vocabulary,
|
|
2597
|
+
id: id,
|
|
2598
|
+
dialectId: dialectId,
|
|
2599
|
+
schema: processSchema(schema, id, dialectId, JsonPointer.nil, anchors, dynamicAnchors),
|
|
2600
|
+
anchors: anchors,
|
|
2601
|
+
dynamicAnchors: dynamicAnchors,
|
|
2602
|
+
vocabulary: vocabulary,
|
|
3575
2603
|
validated: false
|
|
3576
2604
|
};
|
|
3577
|
-
if (id === "https://example.com/schema/root") {
|
|
3578
|
-
console.log(Object.keys(schemaStore).filter((id) => !/json-schema\.org/.test(id)));
|
|
3579
|
-
}
|
|
3580
2605
|
|
|
3581
|
-
|
|
3582
|
-
schemaStoreAlias[resolveUrl$1(retrievalUri, "")] = id;
|
|
3583
|
-
}
|
|
2606
|
+
return id;
|
|
3584
2607
|
};
|
|
3585
2608
|
|
|
3586
|
-
const
|
|
3587
|
-
const
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
2609
|
+
const getSchemaIdentifier = (schema, externalId, jsonSchemaVersion) => {
|
|
2610
|
+
const baseToken = config[jsonSchemaVersion]?.["baseToken"];
|
|
2611
|
+
const internalUrl = resolveUrl$1(externalId, schema[baseToken] || "");
|
|
2612
|
+
return [resolveUrl$1(internalUrl, ""), urlFragment(internalUrl)];
|
|
2613
|
+
};
|
|
2614
|
+
|
|
2615
|
+
const processSchema = (subject, id, dialectId, pointer, anchors, dynamicAnchors) => {
|
|
2616
|
+
if (jsonTypeOf(subject, "object")) {
|
|
2617
|
+
const embeddedSchemaDialectId = typeof subject.$schema === "string" ? resolveUrl$1(subject.$schema, "") : dialectId;
|
|
2618
|
+
const embeddedEmbeddedToken = getConfig(embeddedSchemaDialectId, "embeddedToken");
|
|
2619
|
+
const embeddedAnchorToken = getConfig(embeddedSchemaDialectId, "anchorToken");
|
|
2620
|
+
if (typeof subject[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || subject[embeddedEmbeddedToken][0] !== "#")) {
|
|
2621
|
+
const ref = resolveUrl$1(id, subject[embeddedEmbeddedToken]);
|
|
2622
|
+
const embeddedBaseToken = getConfig(embeddedSchemaDialectId, "baseToken");
|
|
2623
|
+
subject[embeddedBaseToken] = ref;
|
|
2624
|
+
add$1(subject, ref, dialectId);
|
|
2625
|
+
return Reference$1.cons(subject[embeddedEmbeddedToken], subject);
|
|
2626
|
+
}
|
|
3591
2627
|
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
if (
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
// Self describing 2020-12 meta-schema
|
|
3599
|
-
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
3600
|
-
} else {
|
|
3601
|
-
// Need to look at meta-schema to determine version
|
|
3602
|
-
const metaSchema = schemaStore[dialectId];
|
|
3603
|
-
if (!metaSchema) {
|
|
3604
|
-
throw Error(`Couldn't determine JSON Schema version for dialect: '${dialectId}'`);
|
|
3605
|
-
} else if (metaSchema.vocabulary[core201909Id] === true) {
|
|
3606
|
-
dialectJsonSchemaVersion[dialectId] = core201909Id;
|
|
3607
|
-
} else if (metaSchema.vocabulary[core202012Id] === true) {
|
|
3608
|
-
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
3609
|
-
} else {
|
|
3610
|
-
// Assume the jsonSchemaVersion is the meta-schema's dialectId (non-standard behavior)
|
|
3611
|
-
dialectJsonSchemaVersion[dialectId] = dialectJsonSchemaVersion[metaSchema.dialectId];
|
|
3612
|
-
}
|
|
2628
|
+
const anchorToken = getConfig(dialectId, "anchorToken");
|
|
2629
|
+
const dynamicAnchorToken = getConfig(dialectId, "dynamicAnchorToken");
|
|
2630
|
+
if (typeof subject[dynamicAnchorToken] === "string") {
|
|
2631
|
+
dynamicAnchors[subject[dynamicAnchorToken]] = `${id}#${encodeURI(pointer)}`;
|
|
2632
|
+
anchors[subject[dynamicAnchorToken]] = pointer;
|
|
2633
|
+
delete subject[dynamicAnchorToken];
|
|
3613
2634
|
}
|
|
3614
|
-
}
|
|
3615
2635
|
|
|
3616
|
-
|
|
3617
|
-
|
|
2636
|
+
const embeddedToken = getConfig(dialectId, "embeddedToken");
|
|
2637
|
+
if (typeof subject[anchorToken] === "string") {
|
|
2638
|
+
const anchor = anchorToken !== embeddedToken ? subject[anchorToken] : subject[anchorToken].slice(1);
|
|
2639
|
+
anchors[anchor] = pointer;
|
|
2640
|
+
delete subject[anchorToken];
|
|
2641
|
+
}
|
|
3618
2642
|
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
if (!baseUri) {
|
|
3624
|
-
throw Error("Couldn't determine an identifier for the schema");
|
|
3625
|
-
}
|
|
2643
|
+
const jrefToken = getConfig(dialectId, "jrefToken");
|
|
2644
|
+
if (typeof subject[jrefToken] === "string") {
|
|
2645
|
+
return Reference$1.cons(subject[jrefToken], subject);
|
|
2646
|
+
}
|
|
3626
2647
|
|
|
3627
|
-
|
|
2648
|
+
for (const key in subject) {
|
|
2649
|
+
subject[key] = processSchema(subject[key], id, dialectId, JsonPointer.append(key, pointer), anchors, dynamicAnchors);
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
return subject;
|
|
2653
|
+
} else if (Array.isArray(subject)) {
|
|
2654
|
+
return subject.map((item, ndx) => processSchema(item, id, dialectId, JsonPointer.append(ndx, pointer), anchors, dynamicAnchors));
|
|
2655
|
+
} else {
|
|
2656
|
+
return subject;
|
|
2657
|
+
}
|
|
3628
2658
|
};
|
|
3629
2659
|
|
|
3630
2660
|
const hasStoredSchema = (id) => id in schemaStore || id in schemaStoreAlias;
|
|
@@ -3718,14 +2748,14 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3718
2748
|
|
|
3719
2749
|
const keys = (doc) => Object.keys(value(doc));
|
|
3720
2750
|
|
|
3721
|
-
const entries
|
|
2751
|
+
const entries = (doc) => Pact$a.pipeline([
|
|
3722
2752
|
value,
|
|
3723
2753
|
Object.keys,
|
|
3724
2754
|
Pact$a.map(async (key) => [key, await step(key, doc)]),
|
|
3725
2755
|
Pact$a.all
|
|
3726
2756
|
], doc);
|
|
3727
2757
|
|
|
3728
|
-
const map
|
|
2758
|
+
const map = curry$1((fn, doc) => Pact$a.pipeline([
|
|
3729
2759
|
value,
|
|
3730
2760
|
Pact$a.map(async (item, ndx) => fn(await step(ndx, doc), ndx)),
|
|
3731
2761
|
Pact$a.all
|
|
@@ -3741,43 +2771,36 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3741
2771
|
const toSchema = (schemaDoc, options = {}) => {
|
|
3742
2772
|
const fullOptions = { ...toSchemaDefaultOptions, ...options };
|
|
3743
2773
|
|
|
3744
|
-
const
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
const anchors = {};
|
|
3748
|
-
for (const anchor in schemaDoc.anchors) {
|
|
3749
|
-
if (anchor !== "" && !schemaDoc.dynamicAnchors[anchor]) {
|
|
3750
|
-
anchors[schemaDoc.anchors[anchor]] = anchor;
|
|
2774
|
+
const schema = JSON.parse(JSON.stringify(schemaDoc.schema, (key, value) => {
|
|
2775
|
+
if (!Reference$1.isReference(value)) {
|
|
2776
|
+
return value;
|
|
3751
2777
|
}
|
|
3752
|
-
}
|
|
3753
|
-
|
|
3754
|
-
const dynamicAnchors = {};
|
|
3755
|
-
for (const anchor in schemaDoc.dynamicAnchors) {
|
|
3756
|
-
const pointer = urlFragment(schemaDoc.dynamicAnchors[anchor]);
|
|
3757
|
-
dynamicAnchors[pointer] = anchor;
|
|
3758
|
-
}
|
|
3759
2778
|
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
if (!fullOptions.includeEmbedded && embeddedToken in refValue) {
|
|
3766
|
-
return;
|
|
3767
|
-
} else {
|
|
3768
|
-
return Reference$1.value(value);
|
|
3769
|
-
}
|
|
2779
|
+
const refValue = Reference$1.value(value);
|
|
2780
|
+
const embeddedDialect = typeof refValue.$schema === "string" ? resolveUrl$1(refValue.$schema, "") : schemaDoc.dialectId;
|
|
2781
|
+
const embeddedToken = getConfig(embeddedDialect, "embeddedToken");
|
|
2782
|
+
if (!fullOptions.includeEmbedded && embeddedToken in refValue) {
|
|
2783
|
+
return;
|
|
3770
2784
|
} else {
|
|
3771
|
-
|
|
3772
|
-
value = { [anchorToken]: anchors[pointer], ...value };
|
|
3773
|
-
}
|
|
3774
|
-
if (pointer in dynamicAnchors) {
|
|
3775
|
-
value = { [dynamicAnchorToken]: dynamicAnchors[pointer], ...value };
|
|
3776
|
-
}
|
|
3777
|
-
return value;
|
|
2785
|
+
return Reference$1.value(value);
|
|
3778
2786
|
}
|
|
3779
2787
|
}));
|
|
3780
2788
|
|
|
2789
|
+
const dynamicAnchorToken = getConfig(schemaDoc.dialectId, "dynamicAnchorToken");
|
|
2790
|
+
Object.entries(schemaDoc.dynamicAnchors)
|
|
2791
|
+
.forEach(([anchor, uri]) => {
|
|
2792
|
+
const pointer = JsonPointer.append(dynamicAnchorToken, urlFragment(uri));
|
|
2793
|
+
JsonPointer.assign(pointer, schema, anchor);
|
|
2794
|
+
});
|
|
2795
|
+
|
|
2796
|
+
const anchorToken = getConfig(schemaDoc.dialectId, "anchorToken");
|
|
2797
|
+
Object.entries(schemaDoc.anchors)
|
|
2798
|
+
.filter(([anchor]) => anchor !== "" && !(anchor in schemaDoc.dynamicAnchors))
|
|
2799
|
+
.forEach(([anchor, pointer]) => {
|
|
2800
|
+
const anchorPointer = JsonPointer.append(anchorToken, pointer);
|
|
2801
|
+
JsonPointer.assign(anchorPointer, schema, anchor);
|
|
2802
|
+
});
|
|
2803
|
+
|
|
3781
2804
|
const baseToken = getConfig(schemaDoc.dialectId, "baseToken");
|
|
3782
2805
|
const id = relativeUri(fullOptions.parentId, schemaDoc.id);
|
|
3783
2806
|
const dialect = fullOptions.parentDialect === schemaDoc.dialectId ? "" : schemaDoc.dialectId;
|
|
@@ -3800,7 +2823,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3800
2823
|
var schema$5 = {
|
|
3801
2824
|
setConfig, getConfig,
|
|
3802
2825
|
add: add$1, get, markValidated,
|
|
3803
|
-
uri, value, getAnchorPointer, typeOf, has, step, keys, entries
|
|
2826
|
+
uri, value, getAnchorPointer, typeOf, has, step, keys, entries, map, length,
|
|
3804
2827
|
toSchema
|
|
3805
2828
|
};
|
|
3806
2829
|
|
|
@@ -3814,19 +2837,19 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3814
2837
|
|
|
3815
2838
|
var invalidSchemaError = InvalidSchemaError$3;
|
|
3816
2839
|
|
|
3817
|
-
const Schema$
|
|
2840
|
+
const Schema$P = schema$5;
|
|
3818
2841
|
|
|
3819
2842
|
|
|
3820
|
-
const compile$
|
|
3821
|
-
const interpret$
|
|
2843
|
+
const compile$M = (schema) => Schema$P.value(schema);
|
|
2844
|
+
const interpret$M = () => true;
|
|
3822
2845
|
|
|
3823
|
-
var metaData$4 = { compile: compile$
|
|
2846
|
+
var metaData$4 = { compile: compile$M, interpret: interpret$M };
|
|
3824
2847
|
|
|
3825
|
-
const curry
|
|
2848
|
+
const curry = justCurryIt$1;
|
|
3826
2849
|
const PubSub$1 = pubsub.exports;
|
|
3827
2850
|
const { resolveUrl } = common$1;
|
|
3828
|
-
const Instance$
|
|
3829
|
-
const Schema$
|
|
2851
|
+
const Instance$C = instance;
|
|
2852
|
+
const Schema$O = schema$5;
|
|
3830
2853
|
const InvalidSchemaError$2 = invalidSchemaError;
|
|
3831
2854
|
const MediaTypes = mediaTypes;
|
|
3832
2855
|
const metaData$3 = metaData$4;
|
|
@@ -3846,19 +2869,19 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3846
2869
|
});
|
|
3847
2870
|
|
|
3848
2871
|
const validate$2 = async (schema, value = undefined, outputFormat = undefined) => {
|
|
3849
|
-
const compiled = await compile$
|
|
3850
|
-
const interpretAst = (value, outputFormat) => interpret$
|
|
2872
|
+
const compiled = await compile$L(schema);
|
|
2873
|
+
const interpretAst = (value, outputFormat) => interpret$L(compiled, Instance$C.cons(value), outputFormat);
|
|
3851
2874
|
|
|
3852
2875
|
return value === undefined ? interpretAst : interpretAst(value, outputFormat);
|
|
3853
2876
|
};
|
|
3854
2877
|
|
|
3855
|
-
const compile$
|
|
2878
|
+
const compile$L = async (schema) => {
|
|
3856
2879
|
const ast = { metaData: {} };
|
|
3857
2880
|
const schemaUri = await compileSchema(schema, ast);
|
|
3858
2881
|
return { ast, schemaUri };
|
|
3859
2882
|
};
|
|
3860
2883
|
|
|
3861
|
-
const interpret$
|
|
2884
|
+
const interpret$L = curry(({ ast, schemaUri }, value, outputFormat = FLAG) => {
|
|
3862
2885
|
if (![FLAG, BASIC, DETAILED, VERBOSE].includes(outputFormat)) {
|
|
3863
2886
|
throw Error(`The '${outputFormat}' error format is not supported`);
|
|
3864
2887
|
}
|
|
@@ -3933,10 +2956,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3933
2956
|
|
|
3934
2957
|
// Vocabularies
|
|
3935
2958
|
if (!hasKeyword(`${schema.dialectId}#validate`)) {
|
|
3936
|
-
const metaSchema = await Schema$
|
|
2959
|
+
const metaSchema = await Schema$O.get(schema.dialectId);
|
|
3937
2960
|
|
|
3938
2961
|
// Check for mandatory vocabularies
|
|
3939
|
-
const mandatoryVocabularies = Schema$
|
|
2962
|
+
const mandatoryVocabularies = Schema$O.getConfig(metaSchema.id, "mandatoryVocabularies") || [];
|
|
3940
2963
|
mandatoryVocabularies.forEach((vocabularyId) => {
|
|
3941
2964
|
if (!metaSchema.vocabulary[vocabularyId]) {
|
|
3942
2965
|
throw Error(`Vocabulary '${vocabularyId}' must be explicitly declared and required`);
|
|
@@ -3959,17 +2982,17 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3959
2982
|
|
|
3960
2983
|
// Meta validation
|
|
3961
2984
|
if (shouldMetaValidate && !schema.validated) {
|
|
3962
|
-
Schema$
|
|
2985
|
+
Schema$O.markValidated(schema.id);
|
|
3963
2986
|
|
|
3964
2987
|
// Compile
|
|
3965
2988
|
if (!(schema.dialectId in metaValidators)) {
|
|
3966
|
-
const metaSchema = await Schema$
|
|
3967
|
-
const compiledSchema = await compile$
|
|
3968
|
-
metaValidators[metaSchema.id] = interpret$
|
|
2989
|
+
const metaSchema = await Schema$O.get(schema.dialectId);
|
|
2990
|
+
const compiledSchema = await compile$L(metaSchema);
|
|
2991
|
+
metaValidators[metaSchema.id] = interpret$L(compiledSchema);
|
|
3969
2992
|
}
|
|
3970
2993
|
|
|
3971
2994
|
// Interpret
|
|
3972
|
-
const schemaInstance = Instance$
|
|
2995
|
+
const schemaInstance = Instance$C.cons(schema.schema, schema.id);
|
|
3973
2996
|
const metaResults = metaValidators[schema.dialectId](schemaInstance, metaOutputFormat);
|
|
3974
2997
|
if (!metaResults.valid) {
|
|
3975
2998
|
throw new InvalidSchemaError$2(metaResults);
|
|
@@ -3988,7 +3011,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3988
3011
|
};
|
|
3989
3012
|
|
|
3990
3013
|
const followReferences = async (doc) => {
|
|
3991
|
-
return Schema$
|
|
3014
|
+
return Schema$O.typeOf(doc, "string") ? followReferences(await Schema$O.get(Schema$O.value(doc), doc)) : doc;
|
|
3992
3015
|
};
|
|
3993
3016
|
|
|
3994
3017
|
const interpretSchema = (schemaUri, instance, ast, dynamicAnchors) => {
|
|
@@ -4016,45 +3039,45 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4016
3039
|
};
|
|
4017
3040
|
|
|
4018
3041
|
const add = (schema, url = "", defaultSchemaVersion = "") => {
|
|
4019
|
-
const id = Schema$
|
|
3042
|
+
const id = Schema$O.add(schema, url, defaultSchemaVersion);
|
|
4020
3043
|
delete metaValidators[id];
|
|
4021
3044
|
};
|
|
4022
3045
|
|
|
4023
3046
|
var core$2 = {
|
|
4024
|
-
validate: validate$2, compile: compile$
|
|
3047
|
+
validate: validate$2, compile: compile$L, interpret: interpret$L,
|
|
4025
3048
|
setMetaOutputFormat, setShouldMetaValidate, FLAG, BASIC, DETAILED, VERBOSE,
|
|
4026
3049
|
add, getKeyword, hasKeyword, defineVocabulary,
|
|
4027
3050
|
compileSchema, interpretSchema, collectEvaluatedProperties: collectEvaluatedProperties$e, collectEvaluatedItems: collectEvaluatedItems$f,
|
|
4028
3051
|
addMediaTypePlugin: MediaTypes.addPlugin
|
|
4029
3052
|
};
|
|
4030
3053
|
|
|
4031
|
-
const Pact$9 = lib$
|
|
3054
|
+
const Pact$9 = lib$2;
|
|
4032
3055
|
const PubSub = pubsub.exports;
|
|
4033
3056
|
const Core$x = core$2;
|
|
4034
|
-
const Instance$
|
|
4035
|
-
const Schema$
|
|
3057
|
+
const Instance$B = instance;
|
|
3058
|
+
const Schema$N = schema$5;
|
|
4036
3059
|
|
|
4037
3060
|
|
|
4038
|
-
const compile$
|
|
4039
|
-
const url = Schema$
|
|
3061
|
+
const compile$K = async (schema, ast) => {
|
|
3062
|
+
const url = Schema$N.uri(schema);
|
|
4040
3063
|
if (!(url in ast)) {
|
|
4041
3064
|
ast[url] = false; // Place dummy entry in ast to avoid recursive loops
|
|
4042
3065
|
|
|
4043
|
-
const schemaValue = Schema$
|
|
3066
|
+
const schemaValue = Schema$N.value(schema);
|
|
4044
3067
|
if (!["object", "boolean"].includes(typeof schemaValue)) {
|
|
4045
|
-
throw Error(`No schema found at '${Schema$
|
|
3068
|
+
throw Error(`No schema found at '${Schema$N.uri(schema)}'`);
|
|
4046
3069
|
}
|
|
4047
3070
|
|
|
4048
3071
|
ast[url] = [
|
|
4049
3072
|
`${schema.dialectId}#validate`,
|
|
4050
|
-
Schema$
|
|
3073
|
+
Schema$N.uri(schema),
|
|
4051
3074
|
typeof schemaValue === "boolean" ? schemaValue : await Pact$9.pipeline([
|
|
4052
|
-
Schema$
|
|
3075
|
+
Schema$N.entries,
|
|
4053
3076
|
Pact$9.map(([keyword, keywordSchema]) => [`${schema.dialectId}#${keyword}`, keywordSchema]),
|
|
4054
3077
|
Pact$9.filter(([keywordId]) => keywordId !== `${schema.dialectId}#validate`),
|
|
4055
3078
|
Pact$9.map(async ([keywordId, keywordSchema]) => {
|
|
4056
3079
|
const keywordAst = await Core$x.getKeyword(keywordId).compile(keywordSchema, ast, schema);
|
|
4057
|
-
return [keywordId, Schema$
|
|
3080
|
+
return [keywordId, Schema$N.uri(keywordSchema), keywordAst];
|
|
4058
3081
|
}),
|
|
4059
3082
|
Pact$9.all
|
|
4060
3083
|
], schema)
|
|
@@ -4064,7 +3087,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4064
3087
|
return url;
|
|
4065
3088
|
};
|
|
4066
3089
|
|
|
4067
|
-
const interpret$
|
|
3090
|
+
const interpret$K = (uri, instance, ast, dynamicAnchors) => {
|
|
4068
3091
|
const [keywordId, schemaUrl, nodes] = ast[uri];
|
|
4069
3092
|
|
|
4070
3093
|
PubSub.publishSync("result.start");
|
|
@@ -4076,7 +3099,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4076
3099
|
PubSub.publishSync("result", {
|
|
4077
3100
|
keyword: keywordId,
|
|
4078
3101
|
absoluteKeywordLocation: schemaUrl,
|
|
4079
|
-
instanceLocation: Instance$
|
|
3102
|
+
instanceLocation: Instance$B.uri(instance),
|
|
4080
3103
|
valid: isValid,
|
|
4081
3104
|
ast: keywordValue
|
|
4082
3105
|
});
|
|
@@ -4087,7 +3110,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4087
3110
|
PubSub.publishSync("result", {
|
|
4088
3111
|
keyword: keywordId,
|
|
4089
3112
|
absoluteKeywordLocation: schemaUrl,
|
|
4090
|
-
instanceLocation: Instance$
|
|
3113
|
+
instanceLocation: Instance$B.uri(instance),
|
|
4091
3114
|
valid: isValid,
|
|
4092
3115
|
ast: uri
|
|
4093
3116
|
});
|
|
@@ -4125,7 +3148,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4125
3148
|
}, new Set());
|
|
4126
3149
|
};
|
|
4127
3150
|
|
|
4128
|
-
var validate$1 = { compile: compile$
|
|
3151
|
+
var validate$1 = { compile: compile$K, interpret: interpret$K, collectEvaluatedProperties: collectEvaluatedProperties$d, collectEvaluatedItems: collectEvaluatedItems$e };
|
|
4129
3152
|
|
|
4130
3153
|
const metaData$2 = metaData$4;
|
|
4131
3154
|
const validate = validate$1;
|
|
@@ -4134,90 +3157,90 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4134
3157
|
var keywords$6 = { metaData: metaData$2, validate };
|
|
4135
3158
|
|
|
4136
3159
|
const Core$w = core$2;
|
|
4137
|
-
const Schema$
|
|
4138
|
-
const Instance$
|
|
3160
|
+
const Schema$M = schema$5;
|
|
3161
|
+
const Instance$A = instance;
|
|
4139
3162
|
const Reference = reference;
|
|
4140
3163
|
const Keywords$2 = keywords$6;
|
|
4141
3164
|
const InvalidSchemaError$1 = invalidSchemaError;
|
|
4142
3165
|
|
|
4143
3166
|
|
|
4144
|
-
var lib$
|
|
3167
|
+
var lib$1 = { Core: Core$w, Schema: Schema$M, Instance: Instance$A, Reference, Keywords: Keywords$2, InvalidSchemaError: InvalidSchemaError$1 };
|
|
4145
3168
|
|
|
4146
|
-
const { Core: Core$v, Schema: Schema$
|
|
3169
|
+
const { Core: Core$v, Schema: Schema$L, Instance: Instance$z } = lib$1;
|
|
4147
3170
|
|
|
4148
3171
|
|
|
4149
|
-
const compile$
|
|
4150
|
-
const items = await Schema$
|
|
4151
|
-
const numberOfItems = Schema$
|
|
3172
|
+
const compile$J = async (schema, ast, parentSchema) => {
|
|
3173
|
+
const items = await Schema$L.step("items", parentSchema);
|
|
3174
|
+
const numberOfItems = Schema$L.typeOf(items, "array") ? Schema$L.length(items) : Number.MAX_SAFE_INTEGER;
|
|
4152
3175
|
|
|
4153
|
-
if (Schema$
|
|
4154
|
-
return [numberOfItems, Schema$
|
|
3176
|
+
if (Schema$L.typeOf(schema, "boolean")) {
|
|
3177
|
+
return [numberOfItems, Schema$L.value(schema)];
|
|
4155
3178
|
} else {
|
|
4156
3179
|
return [numberOfItems, await Core$v.compileSchema(schema, ast)];
|
|
4157
3180
|
}
|
|
4158
3181
|
};
|
|
4159
3182
|
|
|
4160
|
-
const interpret$
|
|
4161
|
-
if (!Instance$
|
|
3183
|
+
const interpret$J = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
|
|
3184
|
+
if (!Instance$z.typeOf(instance, "array")) {
|
|
4162
3185
|
return true;
|
|
4163
3186
|
}
|
|
4164
3187
|
|
|
4165
3188
|
if (typeof additionalItems === "string") {
|
|
4166
|
-
return Instance$
|
|
3189
|
+
return Instance$z.every((item, ndx) => ndx < numberOfItems || Core$v.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
|
|
4167
3190
|
} else {
|
|
4168
|
-
return Instance$
|
|
3191
|
+
return Instance$z.every((item, ndx) => ndx < numberOfItems ? true : additionalItems, instance);
|
|
4169
3192
|
}
|
|
4170
3193
|
};
|
|
4171
3194
|
|
|
4172
|
-
var additionalItems = { compile: compile$
|
|
3195
|
+
var additionalItems = { compile: compile$J, interpret: interpret$J };
|
|
4173
3196
|
|
|
4174
|
-
const { Core: Core$u, Schema: Schema$
|
|
3197
|
+
const { Core: Core$u, Schema: Schema$K, Instance: Instance$y } = lib$1;
|
|
4175
3198
|
|
|
4176
3199
|
|
|
4177
|
-
const compile$
|
|
4178
|
-
const items = await Schema$
|
|
4179
|
-
const numberOfItems = Schema$
|
|
3200
|
+
const compile$I = async (schema, ast, parentSchema) => {
|
|
3201
|
+
const items = await Schema$K.step("items", parentSchema);
|
|
3202
|
+
const numberOfItems = Schema$K.typeOf(items, "array") ? Schema$K.length(items) : Number.MAX_SAFE_INTEGER;
|
|
4180
3203
|
|
|
4181
3204
|
return [numberOfItems, await Core$u.compileSchema(schema, ast)];
|
|
4182
3205
|
};
|
|
4183
3206
|
|
|
4184
|
-
const interpret$
|
|
4185
|
-
if (!Instance$
|
|
3207
|
+
const interpret$I = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
|
|
3208
|
+
if (!Instance$y.typeOf(instance, "array")) {
|
|
4186
3209
|
return true;
|
|
4187
3210
|
}
|
|
4188
3211
|
|
|
4189
|
-
return Instance$
|
|
3212
|
+
return Instance$y.every((item, ndx) => ndx < numberOfItems || Core$u.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
|
|
4190
3213
|
};
|
|
4191
3214
|
|
|
4192
3215
|
const collectEvaluatedItems$d = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
4193
|
-
return interpret$
|
|
3216
|
+
return interpret$I(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$y.map((item, ndx) => ndx, instance));
|
|
4194
3217
|
};
|
|
4195
3218
|
|
|
4196
|
-
var additionalItems6 = { compile: compile$
|
|
3219
|
+
var additionalItems6 = { compile: compile$I, interpret: interpret$I, collectEvaluatedItems: collectEvaluatedItems$d };
|
|
4197
3220
|
|
|
4198
|
-
const { Core: Core$t, Schema: Schema$
|
|
3221
|
+
const { Core: Core$t, Schema: Schema$J, Instance: Instance$x } = lib$1;
|
|
4199
3222
|
|
|
4200
3223
|
|
|
4201
|
-
const compile$
|
|
4202
|
-
const properties = await Schema$
|
|
4203
|
-
const propertyNames = Schema$
|
|
3224
|
+
const compile$H = async (schema, ast, parentSchema) => {
|
|
3225
|
+
const properties = await Schema$J.step("properties", parentSchema);
|
|
3226
|
+
const propertyNames = Schema$J.typeOf(properties, "object") ? Schema$J.keys(properties) : [];
|
|
4204
3227
|
|
|
4205
|
-
const patternProperties = await Schema$
|
|
4206
|
-
const propertyNamePatterns = Schema$
|
|
3228
|
+
const patternProperties = await Schema$J.step("patternProperties", parentSchema);
|
|
3229
|
+
const propertyNamePatterns = Schema$J.typeOf(patternProperties, "object") ? Schema$J.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
|
|
4207
3230
|
|
|
4208
|
-
if (Schema$
|
|
4209
|
-
return [propertyNames, propertyNamePatterns, Schema$
|
|
3231
|
+
if (Schema$J.typeOf(schema, "boolean")) {
|
|
3232
|
+
return [propertyNames, propertyNamePatterns, Schema$J.value(schema)];
|
|
4210
3233
|
} else {
|
|
4211
3234
|
return [propertyNames, propertyNamePatterns, await Core$t.compileSchema(schema, ast)];
|
|
4212
3235
|
}
|
|
4213
3236
|
};
|
|
4214
3237
|
|
|
4215
|
-
const interpret$
|
|
4216
|
-
if (!Instance$
|
|
3238
|
+
const interpret$H = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
|
|
3239
|
+
if (!Instance$x.typeOf(instance, "object")) {
|
|
4217
3240
|
return true;
|
|
4218
3241
|
}
|
|
4219
3242
|
|
|
4220
|
-
const properties = Instance$
|
|
3243
|
+
const properties = Instance$x.entries(instance)
|
|
4221
3244
|
.filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)));
|
|
4222
3245
|
|
|
4223
3246
|
if (typeof additionalProperties === "string") {
|
|
@@ -4227,168 +3250,47 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4227
3250
|
}
|
|
4228
3251
|
};
|
|
4229
3252
|
|
|
4230
|
-
var additionalProperties = { compile: compile$
|
|
3253
|
+
var additionalProperties = { compile: compile$H, interpret: interpret$H };
|
|
4231
3254
|
|
|
4232
|
-
const { Core: Core$s, Schema: Schema$
|
|
3255
|
+
const { Core: Core$s, Schema: Schema$I, Instance: Instance$w } = lib$1;
|
|
4233
3256
|
|
|
4234
3257
|
|
|
4235
|
-
const compile$
|
|
4236
|
-
const propertiesSchema = await Schema$
|
|
4237
|
-
const propertyNames = Schema$
|
|
3258
|
+
const compile$G = async (schema, ast, parentSchema) => {
|
|
3259
|
+
const propertiesSchema = await Schema$I.step("properties", parentSchema);
|
|
3260
|
+
const propertyNames = Schema$I.typeOf(propertiesSchema, "object") ? Schema$I.keys(propertiesSchema) : [];
|
|
4238
3261
|
|
|
4239
|
-
const patternProperties = await Schema$
|
|
4240
|
-
const propertyNamePatterns = Schema$
|
|
3262
|
+
const patternProperties = await Schema$I.step("patternProperties", parentSchema);
|
|
3263
|
+
const propertyNamePatterns = Schema$I.typeOf(patternProperties, "object") ? Schema$I.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
|
|
4241
3264
|
|
|
4242
3265
|
return [propertyNames, propertyNamePatterns, await Core$s.compileSchema(schema, ast)];
|
|
4243
3266
|
};
|
|
4244
3267
|
|
|
4245
|
-
const interpret$
|
|
4246
|
-
if (!Instance$
|
|
3268
|
+
const interpret$G = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
|
|
3269
|
+
if (!Instance$w.typeOf(instance, "object")) {
|
|
4247
3270
|
return true;
|
|
4248
3271
|
}
|
|
4249
3272
|
|
|
4250
|
-
return Instance$
|
|
3273
|
+
return Instance$w.entries(instance)
|
|
4251
3274
|
.filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)))
|
|
4252
3275
|
.every(([, property]) => Core$s.interpretSchema(additionalProperties, property, ast, dynamicAnchors));
|
|
4253
3276
|
};
|
|
4254
3277
|
|
|
4255
3278
|
const collectEvaluatedProperties$c = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
4256
|
-
return interpret$
|
|
4257
|
-
};
|
|
4258
|
-
|
|
4259
|
-
var additionalProperties6 = { compile: compile$I, interpret: interpret$I, collectEvaluatedProperties: collectEvaluatedProperties$c };
|
|
4260
|
-
|
|
4261
|
-
var entries$1 = async (doc) => Object.entries(await doc);
|
|
4262
|
-
|
|
4263
|
-
var justCurryIt = curry$6;
|
|
4264
|
-
|
|
4265
|
-
/*
|
|
4266
|
-
function add(a, b, c) {
|
|
4267
|
-
return a + b + c;
|
|
4268
|
-
}
|
|
4269
|
-
curry(add)(1)(2)(3); // 6
|
|
4270
|
-
curry(add)(1)(2)(2); // 5
|
|
4271
|
-
curry(add)(2)(4, 3); // 9
|
|
4272
|
-
|
|
4273
|
-
function add(...args) {
|
|
4274
|
-
return args.reduce((sum, n) => sum + n, 0)
|
|
4275
|
-
}
|
|
4276
|
-
var curryAdd4 = curry(add, 4)
|
|
4277
|
-
curryAdd4(1)(2, 3)(4); // 10
|
|
4278
|
-
|
|
4279
|
-
function converter(ratio, input) {
|
|
4280
|
-
return (input*ratio).toFixed(1);
|
|
4281
|
-
}
|
|
4282
|
-
const curriedConverter = curry(converter)
|
|
4283
|
-
const milesToKm = curriedConverter(1.62);
|
|
4284
|
-
milesToKm(35); // 56.7
|
|
4285
|
-
milesToKm(10); // 16.2
|
|
4286
|
-
*/
|
|
4287
|
-
|
|
4288
|
-
function curry$6(fn, arity) {
|
|
4289
|
-
return function curried() {
|
|
4290
|
-
if (arity == null) {
|
|
4291
|
-
arity = fn.length;
|
|
4292
|
-
}
|
|
4293
|
-
var args = [].slice.call(arguments);
|
|
4294
|
-
if (args.length >= arity) {
|
|
4295
|
-
return fn.apply(this, args);
|
|
4296
|
-
} else {
|
|
4297
|
-
return function() {
|
|
4298
|
-
return curried.apply(this, args.concat([].slice.call(arguments)));
|
|
4299
|
-
};
|
|
4300
|
-
}
|
|
4301
|
-
};
|
|
4302
|
-
}
|
|
4303
|
-
|
|
4304
|
-
const curry$5 = justCurryIt;
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
var map$2 = curry$5(async (fn, doc) => (await doc).map(fn));
|
|
4308
|
-
|
|
4309
|
-
const curry$4 = justCurryIt;
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
var reduce$2 = curry$4(async (fn, acc, doc) => {
|
|
4313
|
-
return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
|
|
4314
|
-
});
|
|
4315
|
-
|
|
4316
|
-
const curry$3 = justCurryIt;
|
|
4317
|
-
const reduce$1 = reduce$2;
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
var filter = curry$3(async (fn, doc, options = {}) => {
|
|
4321
|
-
return reduce$1(async (acc, item) => {
|
|
4322
|
-
return (await fn(item)) ? acc.concat([item]) : acc;
|
|
4323
|
-
}, [], doc, options);
|
|
4324
|
-
});
|
|
4325
|
-
|
|
4326
|
-
const curry$2 = justCurryIt;
|
|
4327
|
-
const map$1 = map$2;
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
var some = curry$2(async (fn, doc) => {
|
|
4331
|
-
const results = await map$1(fn, doc);
|
|
4332
|
-
return (await Promise.all(results))
|
|
4333
|
-
.some((a) => a);
|
|
4334
|
-
});
|
|
4335
|
-
|
|
4336
|
-
const curry$1 = justCurryIt;
|
|
4337
|
-
const map = map$2;
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
var every = curry$1(async (fn, doc) => {
|
|
4341
|
-
const results = await map(fn, doc);
|
|
4342
|
-
return (await Promise.all(results))
|
|
4343
|
-
.every((a) => a);
|
|
4344
|
-
});
|
|
4345
|
-
|
|
4346
|
-
const curry = justCurryIt;
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
var pipeline$1 = curry((fns, doc) => {
|
|
4350
|
-
return fns.reduce(async (acc, fn) => fn(await acc), doc);
|
|
4351
|
-
});
|
|
4352
|
-
|
|
4353
|
-
var all = (doc) => Promise.all(doc);
|
|
4354
|
-
|
|
4355
|
-
const pipeline = pipeline$1;
|
|
4356
|
-
const entries = entries$1;
|
|
4357
|
-
const reduce = reduce$2;
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
var allValues = (doc) => {
|
|
4361
|
-
return pipeline([
|
|
4362
|
-
entries,
|
|
4363
|
-
reduce(async (acc, [propertyName, propertyValue]) => {
|
|
4364
|
-
acc[propertyName] = await propertyValue;
|
|
4365
|
-
return acc;
|
|
4366
|
-
}, {})
|
|
4367
|
-
], doc);
|
|
3279
|
+
return interpret$G(keywordValue, instance, ast, dynamicAnchors) && [new RegExp("")];
|
|
4368
3280
|
};
|
|
4369
3281
|
|
|
4370
|
-
var
|
|
4371
|
-
entries: entries$1,
|
|
4372
|
-
map: map$2,
|
|
4373
|
-
filter: filter,
|
|
4374
|
-
reduce: reduce$2,
|
|
4375
|
-
some: some,
|
|
4376
|
-
every: every,
|
|
4377
|
-
pipeline: pipeline$1,
|
|
4378
|
-
all: all,
|
|
4379
|
-
allValues: allValues
|
|
4380
|
-
};
|
|
3282
|
+
var additionalProperties6 = { compile: compile$G, interpret: interpret$G, collectEvaluatedProperties: collectEvaluatedProperties$c };
|
|
4381
3283
|
|
|
4382
|
-
const { Core: Core$r, Schema: Schema$
|
|
4383
|
-
const Pact$8 = lib$
|
|
3284
|
+
const { Core: Core$r, Schema: Schema$H } = lib$1;
|
|
3285
|
+
const Pact$8 = lib$2;
|
|
4384
3286
|
|
|
4385
3287
|
|
|
4386
|
-
const compile$
|
|
4387
|
-
Schema$
|
|
3288
|
+
const compile$F = (schema, ast) => Pact$8.pipeline([
|
|
3289
|
+
Schema$H.map(async (itemSchema) => Core$r.compileSchema(await itemSchema, ast)),
|
|
4388
3290
|
Pact$8.all
|
|
4389
3291
|
], schema);
|
|
4390
3292
|
|
|
4391
|
-
const interpret$
|
|
3293
|
+
const interpret$F = (allOf, instance, ast, dynamicAnchors) => {
|
|
4392
3294
|
return allOf.every((schemaUrl) => Core$r.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
|
|
4393
3295
|
};
|
|
4394
3296
|
|
|
@@ -4406,18 +3308,18 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4406
3308
|
}, new Set());
|
|
4407
3309
|
};
|
|
4408
3310
|
|
|
4409
|
-
var allOf = { compile: compile$
|
|
3311
|
+
var allOf = { compile: compile$F, interpret: interpret$F, collectEvaluatedProperties: collectEvaluatedProperties$b, collectEvaluatedItems: collectEvaluatedItems$c };
|
|
4410
3312
|
|
|
4411
|
-
const { Core: Core$q, Schema: Schema$
|
|
4412
|
-
const Pact$7 = lib$
|
|
3313
|
+
const { Core: Core$q, Schema: Schema$G } = lib$1;
|
|
3314
|
+
const Pact$7 = lib$2;
|
|
4413
3315
|
|
|
4414
3316
|
|
|
4415
|
-
const compile$
|
|
4416
|
-
Schema$
|
|
3317
|
+
const compile$E = (schema, ast) => Pact$7.pipeline([
|
|
3318
|
+
Schema$G.map(async (itemSchema) => Core$q.compileSchema(await itemSchema, ast)),
|
|
4417
3319
|
Pact$7.all
|
|
4418
3320
|
], schema);
|
|
4419
3321
|
|
|
4420
|
-
const interpret$
|
|
3322
|
+
const interpret$E = (anyOf, instance, ast, dynamicAnchors) => {
|
|
4421
3323
|
const matches = anyOf.filter((schemaUrl) => Core$q.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
|
|
4422
3324
|
return matches.length > 0;
|
|
4423
3325
|
};
|
|
@@ -4436,7 +3338,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4436
3338
|
}, false);
|
|
4437
3339
|
};
|
|
4438
3340
|
|
|
4439
|
-
var anyOf = { compile: compile$
|
|
3341
|
+
var anyOf = { compile: compile$E, interpret: interpret$E, collectEvaluatedProperties: collectEvaluatedProperties$a, collectEvaluatedItems: collectEvaluatedItems$b };
|
|
4440
3342
|
|
|
4441
3343
|
var keyList = Object.keys;
|
|
4442
3344
|
var native_stringify = JSON.stringify;
|
|
@@ -4497,92 +3399,92 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4497
3399
|
|
|
4498
3400
|
var fastestStableStringify = function(obj) { return '' + stringify(obj, false); };
|
|
4499
3401
|
|
|
4500
|
-
const { Schema: Schema$
|
|
3402
|
+
const { Schema: Schema$F, Instance: Instance$v } = lib$1;
|
|
4501
3403
|
const jsonStringify$2 = fastestStableStringify;
|
|
4502
3404
|
|
|
4503
3405
|
|
|
4504
|
-
const compile$
|
|
4505
|
-
const interpret$
|
|
3406
|
+
const compile$D = (schema) => jsonStringify$2(Schema$F.value(schema));
|
|
3407
|
+
const interpret$D = (const_, instance) => jsonStringify$2(Instance$v.value(instance)) === const_;
|
|
4506
3408
|
|
|
4507
|
-
var _const = { compile: compile$
|
|
3409
|
+
var _const = { compile: compile$D, interpret: interpret$D };
|
|
4508
3410
|
|
|
4509
|
-
const { Core: Core$p, Instance: Instance$
|
|
3411
|
+
const { Core: Core$p, Instance: Instance$u } = lib$1;
|
|
4510
3412
|
|
|
4511
3413
|
|
|
4512
|
-
const compile$
|
|
3414
|
+
const compile$C = (schema, ast) => Core$p.compileSchema(schema, ast);
|
|
4513
3415
|
|
|
4514
|
-
const interpret$
|
|
4515
|
-
return !Instance$
|
|
3416
|
+
const interpret$C = (contains, instance, ast, dynamicAnchors) => {
|
|
3417
|
+
return !Instance$u.typeOf(instance, "array") || Instance$u.some((item) => Core$p.interpretSchema(contains, item, ast, dynamicAnchors), instance);
|
|
4516
3418
|
};
|
|
4517
3419
|
|
|
4518
|
-
var contains = { compile: compile$
|
|
3420
|
+
var contains = { compile: compile$C, interpret: interpret$C };
|
|
4519
3421
|
|
|
4520
|
-
const { Core: Core$o, Schema: Schema$
|
|
3422
|
+
const { Core: Core$o, Schema: Schema$E, Instance: Instance$t } = lib$1;
|
|
4521
3423
|
|
|
4522
3424
|
|
|
4523
|
-
const compile$
|
|
3425
|
+
const compile$B = async (schema, ast, parentSchema) => {
|
|
4524
3426
|
const contains = await Core$o.compileSchema(schema, ast);
|
|
4525
3427
|
|
|
4526
|
-
const minContainsSchema = await Schema$
|
|
4527
|
-
const minContains = Schema$
|
|
3428
|
+
const minContainsSchema = await Schema$E.step("minContains", parentSchema);
|
|
3429
|
+
const minContains = Schema$E.typeOf(minContainsSchema, "number") ? Schema$E.value(minContainsSchema) : 1;
|
|
4528
3430
|
|
|
4529
|
-
const maxContainsSchema = await Schema$
|
|
4530
|
-
const maxContains = Schema$
|
|
3431
|
+
const maxContainsSchema = await Schema$E.step("maxContains", parentSchema);
|
|
3432
|
+
const maxContains = Schema$E.typeOf(maxContainsSchema, "number") ? Schema$E.value(maxContainsSchema) : Number.MAX_SAFE_INTEGER;
|
|
4531
3433
|
|
|
4532
3434
|
return { contains, minContains, maxContains };
|
|
4533
3435
|
};
|
|
4534
3436
|
|
|
4535
|
-
const interpret$
|
|
4536
|
-
if (!Instance$
|
|
3437
|
+
const interpret$B = ({ contains, minContains, maxContains }, instance, ast, dynamicAnchors) => {
|
|
3438
|
+
if (!Instance$t.typeOf(instance, "array")) {
|
|
4537
3439
|
return true;
|
|
4538
3440
|
}
|
|
4539
3441
|
|
|
4540
|
-
const matches = Instance$
|
|
3442
|
+
const matches = Instance$t.reduce((matches, item) => {
|
|
4541
3443
|
return Core$o.interpretSchema(contains, item, ast, dynamicAnchors) ? matches + 1 : matches;
|
|
4542
3444
|
}, 0, instance);
|
|
4543
3445
|
return matches >= minContains && matches <= maxContains;
|
|
4544
3446
|
};
|
|
4545
3447
|
|
|
4546
3448
|
const collectEvaluatedItems$a = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
4547
|
-
return interpret$
|
|
3449
|
+
return interpret$B(keywordValue, instance, ast, dynamicAnchors) && Instance$t.reduce((matchedIndexes, item, itemIndex) => {
|
|
4548
3450
|
return Core$o.interpretSchema(keywordValue.contains, item, ast, dynamicAnchors) ? matchedIndexes.add(itemIndex) : matchedIndexes;
|
|
4549
3451
|
}, new Set(), instance);
|
|
4550
3452
|
};
|
|
4551
3453
|
|
|
4552
|
-
var containsMinContainsMaxContains = { compile: compile$
|
|
3454
|
+
var containsMinContainsMaxContains = { compile: compile$B, interpret: interpret$B, collectEvaluatedItems: collectEvaluatedItems$a };
|
|
4553
3455
|
|
|
4554
|
-
const { Core: Core$n, Schema: Schema$
|
|
4555
|
-
const Pact$6 = lib$
|
|
3456
|
+
const { Core: Core$n, Schema: Schema$D } = lib$1;
|
|
3457
|
+
const Pact$6 = lib$2;
|
|
4556
3458
|
|
|
4557
3459
|
|
|
4558
|
-
const compile$
|
|
3460
|
+
const compile$A = async (schema, ast) => {
|
|
4559
3461
|
await Pact$6.pipeline([
|
|
4560
|
-
Schema$
|
|
3462
|
+
Schema$D.entries,
|
|
4561
3463
|
Pact$6.map(([, definitionSchema]) => Core$n.compileSchema(definitionSchema, ast)),
|
|
4562
3464
|
Pact$6.all
|
|
4563
3465
|
], schema);
|
|
4564
3466
|
};
|
|
4565
3467
|
|
|
4566
|
-
const interpret$
|
|
3468
|
+
const interpret$A = () => true;
|
|
4567
3469
|
|
|
4568
|
-
var definitions = { compile: compile$
|
|
3470
|
+
var definitions = { compile: compile$A, interpret: interpret$A };
|
|
4569
3471
|
|
|
4570
|
-
const { Core: Core$m, Schema: Schema$
|
|
4571
|
-
const Pact$5 = lib$
|
|
3472
|
+
const { Core: Core$m, Schema: Schema$C, Instance: Instance$s } = lib$1;
|
|
3473
|
+
const Pact$5 = lib$2;
|
|
4572
3474
|
|
|
4573
3475
|
|
|
4574
|
-
const compile$
|
|
4575
|
-
Schema$
|
|
3476
|
+
const compile$z = (schema, ast) => Pact$5.pipeline([
|
|
3477
|
+
Schema$C.entries,
|
|
4576
3478
|
Pact$5.map(async ([key, dependency]) => {
|
|
4577
|
-
return [key, Schema$
|
|
3479
|
+
return [key, Schema$C.typeOf(dependency, "array") ? Schema$C.value(dependency) : await Core$m.compileSchema(dependency, ast)];
|
|
4578
3480
|
}),
|
|
4579
3481
|
Pact$5.all
|
|
4580
3482
|
], schema);
|
|
4581
3483
|
|
|
4582
|
-
const interpret$
|
|
4583
|
-
const value = Instance$
|
|
3484
|
+
const interpret$z = (dependencies, instance, ast, dynamicAnchors) => {
|
|
3485
|
+
const value = Instance$s.value(instance);
|
|
4584
3486
|
|
|
4585
|
-
return !Instance$
|
|
3487
|
+
return !Instance$s.typeOf(instance, "object") || dependencies.every(([propertyName, dependency]) => {
|
|
4586
3488
|
if (!(propertyName in value)) {
|
|
4587
3489
|
return true;
|
|
4588
3490
|
}
|
|
@@ -4595,49 +3497,49 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4595
3497
|
});
|
|
4596
3498
|
};
|
|
4597
3499
|
|
|
4598
|
-
var dependencies = { compile: compile$
|
|
3500
|
+
var dependencies = { compile: compile$z, interpret: interpret$z };
|
|
4599
3501
|
|
|
4600
|
-
const { Schema: Schema$
|
|
4601
|
-
const Pact$4 = lib$
|
|
3502
|
+
const { Schema: Schema$B, Instance: Instance$r } = lib$1;
|
|
3503
|
+
const Pact$4 = lib$2;
|
|
4602
3504
|
|
|
4603
3505
|
|
|
4604
|
-
const compile$
|
|
4605
|
-
Schema$
|
|
4606
|
-
Pact$4.map(([key, dependentRequired]) => [key, Schema$
|
|
3506
|
+
const compile$y = (schema) => Pact$4.pipeline([
|
|
3507
|
+
Schema$B.entries,
|
|
3508
|
+
Pact$4.map(([key, dependentRequired]) => [key, Schema$B.value(dependentRequired)]),
|
|
4607
3509
|
Pact$4.all
|
|
4608
3510
|
], schema);
|
|
4609
3511
|
|
|
4610
|
-
const interpret$
|
|
4611
|
-
const value = Instance$
|
|
3512
|
+
const interpret$y = (dependentRequired, instance) => {
|
|
3513
|
+
const value = Instance$r.value(instance);
|
|
4612
3514
|
|
|
4613
|
-
return !Instance$
|
|
3515
|
+
return !Instance$r.typeOf(instance, "object") || dependentRequired.every(([propertyName, required]) => {
|
|
4614
3516
|
return !(propertyName in value) || required.every((key) => key in value);
|
|
4615
3517
|
});
|
|
4616
3518
|
};
|
|
4617
3519
|
|
|
4618
|
-
var dependentRequired = { compile: compile$
|
|
3520
|
+
var dependentRequired = { compile: compile$y, interpret: interpret$y };
|
|
4619
3521
|
|
|
4620
|
-
const { Core: Core$l, Schema: Schema$
|
|
4621
|
-
const Pact$3 = lib$
|
|
3522
|
+
const { Core: Core$l, Schema: Schema$A, Instance: Instance$q } = lib$1;
|
|
3523
|
+
const Pact$3 = lib$2;
|
|
4622
3524
|
|
|
4623
3525
|
|
|
4624
|
-
const compile$
|
|
4625
|
-
Schema$
|
|
3526
|
+
const compile$x = (schema, ast) => Pact$3.pipeline([
|
|
3527
|
+
Schema$A.entries,
|
|
4626
3528
|
Pact$3.map(async ([key, dependentSchema]) => [key, await Core$l.compileSchema(dependentSchema, ast)]),
|
|
4627
3529
|
Pact$3.all
|
|
4628
3530
|
], schema);
|
|
4629
3531
|
|
|
4630
|
-
const interpret$
|
|
4631
|
-
const value = Instance$
|
|
3532
|
+
const interpret$x = (dependentSchemas, instance, ast, dynamicAnchors) => {
|
|
3533
|
+
const value = Instance$q.value(instance);
|
|
4632
3534
|
|
|
4633
|
-
return !Instance$
|
|
3535
|
+
return !Instance$q.typeOf(instance, "object") || dependentSchemas.every(([propertyName, dependentSchema]) => {
|
|
4634
3536
|
return !(propertyName in value) || Core$l.interpretSchema(dependentSchema, instance, ast, dynamicAnchors);
|
|
4635
3537
|
});
|
|
4636
3538
|
};
|
|
4637
3539
|
|
|
4638
3540
|
const collectEvaluatedProperties$9 = (dependentSchemas, instance, ast, dynamicAnchors) => {
|
|
4639
3541
|
return dependentSchemas.reduce((acc, [propertyName, dependentSchema]) => {
|
|
4640
|
-
if (!acc || !Instance$
|
|
3542
|
+
if (!acc || !Instance$q.has(propertyName, instance)) {
|
|
4641
3543
|
return acc;
|
|
4642
3544
|
}
|
|
4643
3545
|
|
|
@@ -4646,39 +3548,39 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4646
3548
|
}, []);
|
|
4647
3549
|
};
|
|
4648
3550
|
|
|
4649
|
-
var dependentSchemas = { compile: compile$
|
|
3551
|
+
var dependentSchemas = { compile: compile$x, interpret: interpret$x, collectEvaluatedProperties: collectEvaluatedProperties$9 };
|
|
4650
3552
|
|
|
4651
|
-
const { Schema: Schema$
|
|
3553
|
+
const { Schema: Schema$z, Instance: Instance$p } = lib$1;
|
|
4652
3554
|
const jsonStringify$1 = fastestStableStringify;
|
|
4653
3555
|
|
|
4654
3556
|
|
|
4655
|
-
const compile$
|
|
4656
|
-
const interpret$
|
|
3557
|
+
const compile$w = (schema) => Schema$z.value(schema).map(jsonStringify$1);
|
|
3558
|
+
const interpret$w = (enum_, instance) => enum_.some((enumValue) => jsonStringify$1(Instance$p.value(instance)) === enumValue);
|
|
4657
3559
|
|
|
4658
|
-
var _enum = { compile: compile$
|
|
3560
|
+
var _enum = { compile: compile$w, interpret: interpret$w };
|
|
4659
3561
|
|
|
4660
|
-
const { Schema: Schema$
|
|
3562
|
+
const { Schema: Schema$y, Instance: Instance$o } = lib$1;
|
|
4661
3563
|
|
|
4662
3564
|
|
|
4663
|
-
const compile$
|
|
4664
|
-
const interpret$
|
|
3565
|
+
const compile$v = async (schema) => Schema$y.value(schema);
|
|
3566
|
+
const interpret$v = (exclusiveMaximum, instance) => !Instance$o.typeOf(instance, "number") || Instance$o.value(instance) < exclusiveMaximum;
|
|
4665
3567
|
|
|
4666
|
-
var exclusiveMaximum = { compile: compile$
|
|
3568
|
+
var exclusiveMaximum = { compile: compile$v, interpret: interpret$v };
|
|
4667
3569
|
|
|
4668
|
-
const { Schema: Schema$
|
|
3570
|
+
const { Schema: Schema$x, Instance: Instance$n } = lib$1;
|
|
4669
3571
|
|
|
4670
3572
|
|
|
4671
|
-
const compile$
|
|
4672
|
-
const interpret$
|
|
3573
|
+
const compile$u = async (schema) => Schema$x.value(schema);
|
|
3574
|
+
const interpret$u = (exclusiveMinimum, instance) => !Instance$n.typeOf(instance, "number") || Instance$n.value(instance) > exclusiveMinimum;
|
|
4673
3575
|
|
|
4674
|
-
var exclusiveMinimum = { compile: compile$
|
|
3576
|
+
var exclusiveMinimum = { compile: compile$u, interpret: interpret$u };
|
|
4675
3577
|
|
|
4676
|
-
const { Core: Core$k } = lib$
|
|
3578
|
+
const { Core: Core$k } = lib$1;
|
|
4677
3579
|
|
|
4678
3580
|
|
|
4679
|
-
const compile$
|
|
3581
|
+
const compile$t = (schema, ast) => Core$k.compileSchema(schema, ast);
|
|
4680
3582
|
|
|
4681
|
-
const interpret$
|
|
3583
|
+
const interpret$t = (ifSchema, instance, ast, dynamicAnchors) => {
|
|
4682
3584
|
Core$k.interpretSchema(ifSchema, instance, ast, dynamicAnchors);
|
|
4683
3585
|
return true;
|
|
4684
3586
|
};
|
|
@@ -4691,21 +3593,21 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4691
3593
|
return Core$k.collectEvaluatedItems(ifSchema, instance, ast, dynamicAnchors) || new Set();
|
|
4692
3594
|
};
|
|
4693
3595
|
|
|
4694
|
-
var _if = { compile: compile$
|
|
3596
|
+
var _if = { compile: compile$t, interpret: interpret$t, collectEvaluatedProperties: collectEvaluatedProperties$8, collectEvaluatedItems: collectEvaluatedItems$9 };
|
|
4695
3597
|
|
|
4696
|
-
const { Core: Core$j, Schema: Schema$
|
|
3598
|
+
const { Core: Core$j, Schema: Schema$w } = lib$1;
|
|
4697
3599
|
|
|
4698
3600
|
|
|
4699
|
-
const compile$
|
|
4700
|
-
if (Schema$
|
|
4701
|
-
const ifSchema = await Schema$
|
|
3601
|
+
const compile$s = async (schema, ast, parentSchema) => {
|
|
3602
|
+
if (Schema$w.has("if", parentSchema)) {
|
|
3603
|
+
const ifSchema = await Schema$w.step("if", parentSchema);
|
|
4702
3604
|
return [await Core$j.compileSchema(ifSchema, ast), await Core$j.compileSchema(schema, ast)];
|
|
4703
3605
|
} else {
|
|
4704
3606
|
return [];
|
|
4705
3607
|
}
|
|
4706
3608
|
};
|
|
4707
3609
|
|
|
4708
|
-
const interpret$
|
|
3610
|
+
const interpret$s = ([guard, block], instance, ast, dynamicAnchors) => {
|
|
4709
3611
|
return guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors) || Core$j.interpretSchema(block, instance, ast, dynamicAnchors);
|
|
4710
3612
|
};
|
|
4711
3613
|
|
|
@@ -4735,21 +3637,21 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4735
3637
|
return Core$j.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
|
|
4736
3638
|
};
|
|
4737
3639
|
|
|
4738
|
-
var then = { compile: compile$
|
|
3640
|
+
var then = { compile: compile$s, interpret: interpret$s, collectEvaluatedProperties: collectEvaluatedProperties$7, collectEvaluatedItems: collectEvaluatedItems$8 };
|
|
4739
3641
|
|
|
4740
|
-
const { Core: Core$i, Schema: Schema$
|
|
3642
|
+
const { Core: Core$i, Schema: Schema$v } = lib$1;
|
|
4741
3643
|
|
|
4742
3644
|
|
|
4743
|
-
const compile$
|
|
4744
|
-
if (Schema$
|
|
4745
|
-
const ifSchema = await Schema$
|
|
3645
|
+
const compile$r = async (schema, ast, parentSchema) => {
|
|
3646
|
+
if (Schema$v.has("if", parentSchema)) {
|
|
3647
|
+
const ifSchema = await Schema$v.step("if", parentSchema);
|
|
4746
3648
|
return [await Core$i.compileSchema(ifSchema, ast), await Core$i.compileSchema(schema, ast)];
|
|
4747
3649
|
} else {
|
|
4748
3650
|
return [];
|
|
4749
3651
|
}
|
|
4750
3652
|
};
|
|
4751
3653
|
|
|
4752
|
-
const interpret$
|
|
3654
|
+
const interpret$r = ([guard, block], instance, ast, dynamicAnchors) => {
|
|
4753
3655
|
return guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors) || Core$i.interpretSchema(block, instance, ast, dynamicAnchors);
|
|
4754
3656
|
};
|
|
4755
3657
|
|
|
@@ -4779,150 +3681,134 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4779
3681
|
return Core$i.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
|
|
4780
3682
|
};
|
|
4781
3683
|
|
|
4782
|
-
var _else = { compile: compile$
|
|
3684
|
+
var _else = { compile: compile$r, interpret: interpret$r, collectEvaluatedProperties: collectEvaluatedProperties$6, collectEvaluatedItems: collectEvaluatedItems$7 };
|
|
4783
3685
|
|
|
4784
|
-
const { Core: Core$h, Schema: Schema$
|
|
3686
|
+
const { Core: Core$h, Schema: Schema$u, Instance: Instance$m } = lib$1;
|
|
4785
3687
|
|
|
4786
3688
|
|
|
4787
|
-
const compile$
|
|
4788
|
-
if (Schema$
|
|
4789
|
-
const tupleItems = await Schema$
|
|
3689
|
+
const compile$q = async (schema, ast) => {
|
|
3690
|
+
if (Schema$u.typeOf(schema, "array")) {
|
|
3691
|
+
const tupleItems = await Schema$u.map((itemSchema) => Core$h.compileSchema(itemSchema, ast), schema);
|
|
4790
3692
|
return Promise.all(tupleItems);
|
|
4791
3693
|
} else {
|
|
4792
3694
|
return Core$h.compileSchema(schema, ast);
|
|
4793
3695
|
}
|
|
4794
3696
|
};
|
|
4795
3697
|
|
|
4796
|
-
const interpret$
|
|
4797
|
-
if (!Instance$
|
|
3698
|
+
const interpret$q = (items, instance, ast, dynamicAnchors) => {
|
|
3699
|
+
if (!Instance$m.typeOf(instance, "array")) {
|
|
4798
3700
|
return true;
|
|
4799
3701
|
}
|
|
4800
3702
|
|
|
4801
3703
|
if (typeof items === "string") {
|
|
4802
|
-
return Instance$
|
|
3704
|
+
return Instance$m.every((itemValue) => Core$h.interpretSchema(items, itemValue, ast, dynamicAnchors), instance);
|
|
4803
3705
|
} else {
|
|
4804
|
-
return Instance$
|
|
3706
|
+
return Instance$m.every((item, ndx) => !(ndx in items) || Core$h.interpretSchema(items[ndx], item, ast, dynamicAnchors), instance);
|
|
4805
3707
|
}
|
|
4806
3708
|
};
|
|
4807
3709
|
|
|
4808
3710
|
const collectEvaluatedItems$6 = (items, instance, ast, dynamicAnchors) => {
|
|
4809
|
-
return interpret$
|
|
4810
|
-
? new Set(Instance$
|
|
3711
|
+
return interpret$q(items, instance, ast, dynamicAnchors) && (typeof items === "string"
|
|
3712
|
+
? new Set(Instance$m.map((item, itemIndex) => itemIndex, instance))
|
|
4811
3713
|
: new Set(items.map((item, itemIndex) => itemIndex)));
|
|
4812
3714
|
};
|
|
4813
3715
|
|
|
4814
|
-
var items = { compile: compile$
|
|
3716
|
+
var items = { compile: compile$q, interpret: interpret$q, collectEvaluatedItems: collectEvaluatedItems$6 };
|
|
4815
3717
|
|
|
4816
|
-
const { Core: Core$g, Schema: Schema$
|
|
3718
|
+
const { Core: Core$g, Schema: Schema$t, Instance: Instance$l } = lib$1;
|
|
4817
3719
|
|
|
4818
3720
|
|
|
4819
|
-
const compile$
|
|
4820
|
-
const items = await Schema$
|
|
4821
|
-
const numberOfPrefixItems = Schema$
|
|
3721
|
+
const compile$p = async (schema, ast, parentSchema) => {
|
|
3722
|
+
const items = await Schema$t.step("prefixItems", parentSchema);
|
|
3723
|
+
const numberOfPrefixItems = Schema$t.typeOf(items, "array") ? Schema$t.length(items) : 0;
|
|
4822
3724
|
|
|
4823
3725
|
return [numberOfPrefixItems, await Core$g.compileSchema(schema, ast)];
|
|
4824
3726
|
};
|
|
4825
3727
|
|
|
4826
|
-
const interpret$
|
|
4827
|
-
if (!Instance$
|
|
3728
|
+
const interpret$p = ([numberOfPrefixItems, items], instance, ast, dynamicAnchors) => {
|
|
3729
|
+
if (!Instance$l.typeOf(instance, "array")) {
|
|
4828
3730
|
return true;
|
|
4829
3731
|
}
|
|
4830
3732
|
|
|
4831
|
-
return Instance$
|
|
3733
|
+
return Instance$l.every((item, ndx) => ndx < numberOfPrefixItems || Core$g.interpretSchema(items, item, ast, dynamicAnchors), instance);
|
|
4832
3734
|
};
|
|
4833
3735
|
|
|
4834
3736
|
const collectEvaluatedItems$5 = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
4835
|
-
return interpret$
|
|
3737
|
+
return interpret$p(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$l.map((item, ndx) => ndx, instance));
|
|
4836
3738
|
};
|
|
4837
3739
|
|
|
4838
|
-
var items202012 = { compile: compile$
|
|
4839
|
-
|
|
4840
|
-
const { Schema: Schema$u, Instance: Instance$m } = lib$2;
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
const compile$q = (schema) => Schema$u.value(schema);
|
|
4844
|
-
const interpret$q = (maxItems, instance) => !Instance$m.typeOf(instance, "array") || Instance$m.length(instance) <= maxItems;
|
|
4845
|
-
|
|
4846
|
-
var maxItems = { compile: compile$q, interpret: interpret$q };
|
|
3740
|
+
var items202012 = { compile: compile$p, interpret: interpret$p, collectEvaluatedItems: collectEvaluatedItems$5 };
|
|
4847
3741
|
|
|
4848
|
-
const { Schema: Schema$
|
|
3742
|
+
const { Schema: Schema$s, Instance: Instance$k } = lib$1;
|
|
4849
3743
|
|
|
4850
3744
|
|
|
4851
|
-
const compile$
|
|
4852
|
-
const interpret$
|
|
3745
|
+
const compile$o = (schema) => Schema$s.value(schema);
|
|
3746
|
+
const interpret$o = (maxItems, instance) => !Instance$k.typeOf(instance, "array") || Instance$k.length(instance) <= maxItems;
|
|
4853
3747
|
|
|
4854
|
-
var
|
|
3748
|
+
var maxItems = { compile: compile$o, interpret: interpret$o };
|
|
4855
3749
|
|
|
4856
|
-
const { Schema: Schema$
|
|
3750
|
+
const { Schema: Schema$r, Instance: Instance$j } = lib$1;
|
|
4857
3751
|
|
|
4858
3752
|
|
|
4859
|
-
const compile$
|
|
4860
|
-
const interpret$
|
|
3753
|
+
const compile$n = (schema) => Schema$r.value(schema);
|
|
3754
|
+
const interpret$n = (maxLength, instance) => !Instance$j.typeOf(instance, "string") || [...Instance$j.value(instance)].length <= maxLength;
|
|
4861
3755
|
|
|
4862
|
-
var
|
|
3756
|
+
var maxLength = { compile: compile$n, interpret: interpret$n };
|
|
4863
3757
|
|
|
4864
|
-
const { Schema: Schema$
|
|
3758
|
+
const { Schema: Schema$q, Instance: Instance$i } = lib$1;
|
|
4865
3759
|
|
|
4866
3760
|
|
|
4867
|
-
const compile$
|
|
4868
|
-
const interpret$
|
|
3761
|
+
const compile$m = (schema) => Schema$q.value(schema);
|
|
3762
|
+
const interpret$m = (maxProperties, instance) => !Instance$i.typeOf(instance, "object") || Instance$i.keys(instance).length <= maxProperties;
|
|
4869
3763
|
|
|
4870
|
-
var maxProperties = { compile: compile$
|
|
3764
|
+
var maxProperties = { compile: compile$m, interpret: interpret$m };
|
|
4871
3765
|
|
|
4872
|
-
const { Schema: Schema$
|
|
3766
|
+
const { Schema: Schema$p, Instance: Instance$h } = lib$1;
|
|
4873
3767
|
|
|
4874
3768
|
|
|
4875
|
-
const compile$
|
|
4876
|
-
const exclusiveMaximum = await Schema$
|
|
4877
|
-
const isExclusive = Schema$
|
|
3769
|
+
const compile$l = async (schema, ast, parentSchema) => {
|
|
3770
|
+
const exclusiveMaximum = await Schema$p.step("exclusiveMaximum", parentSchema);
|
|
3771
|
+
const isExclusive = Schema$p.value(exclusiveMaximum);
|
|
4878
3772
|
|
|
4879
|
-
return [Schema$
|
|
3773
|
+
return [Schema$p.value(schema), isExclusive];
|
|
4880
3774
|
};
|
|
4881
3775
|
|
|
4882
|
-
const interpret$
|
|
4883
|
-
if (!Instance$
|
|
3776
|
+
const interpret$l = ([maximum, isExclusive], instance) => {
|
|
3777
|
+
if (!Instance$h.typeOf(instance, "number")) {
|
|
4884
3778
|
return true;
|
|
4885
3779
|
}
|
|
4886
3780
|
|
|
4887
|
-
const value = Instance$
|
|
3781
|
+
const value = Instance$h.value(instance);
|
|
4888
3782
|
return isExclusive ? value < maximum : value <= maximum;
|
|
4889
3783
|
};
|
|
4890
3784
|
|
|
4891
|
-
var maximumExclusiveMaximum = { compile: compile$
|
|
4892
|
-
|
|
4893
|
-
const { Schema: Schema$p, Instance: Instance$h } = lib$2;
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
const compile$l = async (schema) => Schema$p.value(schema);
|
|
4897
|
-
const interpret$l = (maximum, instance) => !Instance$h.typeOf(instance, "number") || Instance$h.value(instance) <= maximum;
|
|
4898
|
-
|
|
4899
|
-
var maximum = { compile: compile$l, interpret: interpret$l };
|
|
3785
|
+
var maximumExclusiveMaximum = { compile: compile$l, interpret: interpret$l };
|
|
4900
3786
|
|
|
4901
|
-
const { Schema: Schema$o, Instance: Instance$g } = lib$
|
|
3787
|
+
const { Schema: Schema$o, Instance: Instance$g } = lib$1;
|
|
4902
3788
|
|
|
4903
3789
|
|
|
4904
|
-
const compile$k = (schema) => Schema$o.value(schema);
|
|
4905
|
-
const interpret$k = (
|
|
3790
|
+
const compile$k = async (schema) => Schema$o.value(schema);
|
|
3791
|
+
const interpret$k = (maximum, instance) => !Instance$g.typeOf(instance, "number") || Instance$g.value(instance) <= maximum;
|
|
4906
3792
|
|
|
4907
|
-
var
|
|
3793
|
+
var maximum = { compile: compile$k, interpret: interpret$k };
|
|
4908
3794
|
|
|
4909
|
-
const { Schema: Schema$n, Instance: Instance$f } = lib$
|
|
3795
|
+
const { Schema: Schema$n, Instance: Instance$f } = lib$1;
|
|
4910
3796
|
|
|
4911
3797
|
|
|
4912
3798
|
const compile$j = (schema) => Schema$n.value(schema);
|
|
4913
|
-
const interpret$j = (
|
|
3799
|
+
const interpret$j = (minItems, instance) => !Instance$f.typeOf(instance, "array") || Instance$f.length(instance) >= minItems;
|
|
4914
3800
|
|
|
4915
|
-
var
|
|
3801
|
+
var minItems = { compile: compile$j, interpret: interpret$j };
|
|
4916
3802
|
|
|
4917
|
-
const { Schema: Schema$m, Instance: Instance$e } = lib$
|
|
3803
|
+
const { Schema: Schema$m, Instance: Instance$e } = lib$1;
|
|
4918
3804
|
|
|
4919
3805
|
|
|
4920
3806
|
const compile$i = (schema) => Schema$m.value(schema);
|
|
4921
3807
|
const interpret$i = (minLength, instance) => !Instance$e.typeOf(instance, "string") || [...Instance$e.value(instance)].length >= minLength;
|
|
4922
3808
|
|
|
4923
|
-
var
|
|
3809
|
+
var minLength = { compile: compile$i, interpret: interpret$i };
|
|
4924
3810
|
|
|
4925
|
-
const { Schema: Schema$l, Instance: Instance$d } = lib$
|
|
3811
|
+
const { Schema: Schema$l, Instance: Instance$d } = lib$1;
|
|
4926
3812
|
|
|
4927
3813
|
|
|
4928
3814
|
const compile$h = (schema) => Schema$l.value(schema);
|
|
@@ -4930,7 +3816,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4930
3816
|
|
|
4931
3817
|
var minProperties = { compile: compile$h, interpret: interpret$h };
|
|
4932
3818
|
|
|
4933
|
-
const { Schema: Schema$k, Instance: Instance$c } = lib$
|
|
3819
|
+
const { Schema: Schema$k, Instance: Instance$c } = lib$1;
|
|
4934
3820
|
|
|
4935
3821
|
|
|
4936
3822
|
const compile$g = async (schema, ast, parentSchema) => {
|
|
@@ -4951,7 +3837,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4951
3837
|
|
|
4952
3838
|
var minimumExclusiveMinimum = { compile: compile$g, interpret: interpret$g };
|
|
4953
3839
|
|
|
4954
|
-
const { Schema: Schema$j, Instance: Instance$b } = lib$
|
|
3840
|
+
const { Schema: Schema$j, Instance: Instance$b } = lib$1;
|
|
4955
3841
|
|
|
4956
3842
|
|
|
4957
3843
|
const compile$f = async (schema) => Schema$j.value(schema);
|
|
@@ -4959,7 +3845,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4959
3845
|
|
|
4960
3846
|
var minimum = { compile: compile$f, interpret: interpret$f };
|
|
4961
3847
|
|
|
4962
|
-
const { Schema: Schema$i, Instance: Instance$a } = lib$
|
|
3848
|
+
const { Schema: Schema$i, Instance: Instance$a } = lib$1;
|
|
4963
3849
|
|
|
4964
3850
|
|
|
4965
3851
|
const compile$e = (schema) => Schema$i.value(schema);
|
|
@@ -4977,7 +3863,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4977
3863
|
|
|
4978
3864
|
var multipleOf = { compile: compile$e, interpret: interpret$e };
|
|
4979
3865
|
|
|
4980
|
-
const { Core: Core$f } = lib$
|
|
3866
|
+
const { Core: Core$f } = lib$1;
|
|
4981
3867
|
|
|
4982
3868
|
|
|
4983
3869
|
const compile$d = Core$f.compileSchema;
|
|
@@ -4985,7 +3871,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4985
3871
|
|
|
4986
3872
|
var not = { compile: compile$d, interpret: interpret$d };
|
|
4987
3873
|
|
|
4988
|
-
const { Core: Core$e, Schema: Schema$h } = lib$
|
|
3874
|
+
const { Core: Core$e, Schema: Schema$h } = lib$1;
|
|
4989
3875
|
|
|
4990
3876
|
|
|
4991
3877
|
const compile$c = async (schema, ast) => {
|
|
@@ -5034,7 +3920,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5034
3920
|
|
|
5035
3921
|
var oneOf = { compile: compile$c, interpret: interpret$c, collectEvaluatedProperties: collectEvaluatedProperties$5, collectEvaluatedItems: collectEvaluatedItems$4 };
|
|
5036
3922
|
|
|
5037
|
-
const { Schema: Schema$g, Instance: Instance$9 } = lib$
|
|
3923
|
+
const { Schema: Schema$g, Instance: Instance$9 } = lib$1;
|
|
5038
3924
|
|
|
5039
3925
|
|
|
5040
3926
|
const compile$b = (schema) => new RegExp(Schema$g.value(schema), "u");
|
|
@@ -5042,8 +3928,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5042
3928
|
|
|
5043
3929
|
var pattern = { compile: compile$b, interpret: interpret$b };
|
|
5044
3930
|
|
|
5045
|
-
const { Core: Core$d, Schema: Schema$f, Instance: Instance$8 } = lib$
|
|
5046
|
-
const Pact$2 = lib$
|
|
3931
|
+
const { Core: Core$d, Schema: Schema$f, Instance: Instance$8 } = lib$1;
|
|
3932
|
+
const Pact$2 = lib$2;
|
|
5047
3933
|
|
|
5048
3934
|
|
|
5049
3935
|
const compile$a = (schema, ast) => Pact$2.pipeline([
|
|
@@ -5080,8 +3966,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5080
3966
|
|
|
5081
3967
|
var common = { isObject, escapeRegExp: escapeRegExp$1, splitUrl: splitUrl$1 };
|
|
5082
3968
|
|
|
5083
|
-
const { Core: Core$c, Schema: Schema$e, Instance: Instance$7 } = lib$
|
|
5084
|
-
const Pact$1 = lib$
|
|
3969
|
+
const { Core: Core$c, Schema: Schema$e, Instance: Instance$7 } = lib$1;
|
|
3970
|
+
const Pact$1 = lib$2;
|
|
5085
3971
|
const { escapeRegExp } = common;
|
|
5086
3972
|
|
|
5087
3973
|
|
|
@@ -5106,7 +3992,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5106
3992
|
|
|
5107
3993
|
var properties = { compile: compile$9, interpret: interpret$9, collectEvaluatedProperties: collectEvaluatedProperties$3 };
|
|
5108
3994
|
|
|
5109
|
-
const { Core: Core$b, Instance: Instance$6 } = lib$
|
|
3995
|
+
const { Core: Core$b, Instance: Instance$6 } = lib$1;
|
|
5110
3996
|
|
|
5111
3997
|
|
|
5112
3998
|
const compile$8 = (schema, ast) => Core$b.compileSchema(schema, ast);
|
|
@@ -5118,7 +4004,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5118
4004
|
|
|
5119
4005
|
var propertyNames = { compile: compile$8, interpret: interpret$8 };
|
|
5120
4006
|
|
|
5121
|
-
const { Core: Core$a, Schema: Schema$d } = lib$
|
|
4007
|
+
const { Core: Core$a, Schema: Schema$d } = lib$1;
|
|
5122
4008
|
const { splitUrl } = common;
|
|
5123
4009
|
|
|
5124
4010
|
|
|
@@ -5143,7 +4029,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5143
4029
|
|
|
5144
4030
|
var dynamicRef = { compile: compile$7, interpret: interpret$7, collectEvaluatedProperties: collectEvaluatedProperties$2, collectEvaluatedItems: collectEvaluatedItems$3 };
|
|
5145
4031
|
|
|
5146
|
-
const { Core: Core$9, Schema: Schema$c } = lib$
|
|
4032
|
+
const { Core: Core$9, Schema: Schema$c } = lib$1;
|
|
5147
4033
|
|
|
5148
4034
|
|
|
5149
4035
|
const compile$6 = async (ref, ast) => {
|
|
@@ -5157,7 +4043,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5157
4043
|
|
|
5158
4044
|
var ref = { compile: compile$6, interpret: interpret$6, collectEvaluatedProperties: collectEvaluatedProperties$1, collectEvaluatedItems: collectEvaluatedItems$2 };
|
|
5159
4045
|
|
|
5160
|
-
const { Schema: Schema$b, Instance: Instance$5 } = lib$
|
|
4046
|
+
const { Schema: Schema$b, Instance: Instance$5 } = lib$1;
|
|
5161
4047
|
|
|
5162
4048
|
|
|
5163
4049
|
const compile$5 = (schema) => Schema$b.value(schema);
|
|
@@ -5168,8 +4054,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5168
4054
|
|
|
5169
4055
|
var required = { compile: compile$5, interpret: interpret$5 };
|
|
5170
4056
|
|
|
5171
|
-
const { Core: Core$8, Schema: Schema$a, Instance: Instance$4 } = lib$
|
|
5172
|
-
const Pact = lib$
|
|
4057
|
+
const { Core: Core$8, Schema: Schema$a, Instance: Instance$4 } = lib$1;
|
|
4058
|
+
const Pact = lib$2;
|
|
5173
4059
|
|
|
5174
4060
|
|
|
5175
4061
|
const compile$4 = (schema, ast) => {
|
|
@@ -5193,7 +4079,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5193
4079
|
|
|
5194
4080
|
var tupleItems = { compile: compile$4, interpret: interpret$4, collectEvaluatedItems: collectEvaluatedItems$1 };
|
|
5195
4081
|
|
|
5196
|
-
const { Schema: Schema$9, Instance: Instance$3 } = lib$
|
|
4082
|
+
const { Schema: Schema$9, Instance: Instance$3 } = lib$1;
|
|
5197
4083
|
|
|
5198
4084
|
|
|
5199
4085
|
const compile$3 = (schema) => Schema$9.value(schema);
|
|
@@ -5201,7 +4087,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5201
4087
|
|
|
5202
4088
|
var type = { compile: compile$3, interpret: interpret$3 };
|
|
5203
4089
|
|
|
5204
|
-
const { Core: Core$7, Schema: Schema$8, Instance: Instance$2 } = lib$
|
|
4090
|
+
const { Core: Core$7, Schema: Schema$8, Instance: Instance$2 } = lib$1;
|
|
5205
4091
|
|
|
5206
4092
|
|
|
5207
4093
|
const compile$2 = async (schema, ast, parentSchema) => {
|
|
@@ -5225,7 +4111,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5225
4111
|
|
|
5226
4112
|
var unevaluatedItems = { compile: compile$2, interpret: interpret$2, collectEvaluatedItems };
|
|
5227
4113
|
|
|
5228
|
-
const { Core: Core$6, Schema: Schema$7, Instance: Instance$1 } = lib$
|
|
4114
|
+
const { Core: Core$6, Schema: Schema$7, Instance: Instance$1 } = lib$1;
|
|
5229
4115
|
|
|
5230
4116
|
|
|
5231
4117
|
const compile$1 = async (schema, ast, parentSchema) => {
|
|
@@ -5250,7 +4136,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5250
4136
|
|
|
5251
4137
|
var unevaluatedProperties = { compile: compile$1, interpret: interpret$1, collectEvaluatedProperties };
|
|
5252
4138
|
|
|
5253
|
-
const { Schema: Schema$6, Instance } = lib$
|
|
4139
|
+
const { Schema: Schema$6, Instance } = lib$1;
|
|
5254
4140
|
const jsonStringify = fastestStableStringify;
|
|
5255
4141
|
|
|
5256
4142
|
|
|
@@ -5267,7 +4153,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5267
4153
|
|
|
5268
4154
|
var uniqueItems = { compile, interpret };
|
|
5269
4155
|
|
|
5270
|
-
const { Keywords: Keywords$1 } = lib$
|
|
4156
|
+
const { Keywords: Keywords$1 } = lib$1;
|
|
5271
4157
|
|
|
5272
4158
|
|
|
5273
4159
|
var keywords$5 = {
|
|
@@ -5294,14 +4180,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5294
4180
|
items202012: items202012,
|
|
5295
4181
|
maxItems: maxItems,
|
|
5296
4182
|
maxLength: maxLength,
|
|
5297
|
-
maxLength6: maxLength6,
|
|
5298
4183
|
maxProperties: maxProperties,
|
|
5299
4184
|
maximumExclusiveMaximum: maximumExclusiveMaximum,
|
|
5300
4185
|
maximum: maximum,
|
|
5301
4186
|
metaData: Keywords$1.metaData,
|
|
5302
4187
|
minItems: minItems,
|
|
5303
4188
|
minLength: minLength,
|
|
5304
|
-
minLength6: minLength6,
|
|
5305
4189
|
minProperties: minProperties,
|
|
5306
4190
|
minimumExclusiveMinimum: minimumExclusiveMinimum,
|
|
5307
4191
|
minimum: minimum,
|
|
@@ -5473,7 +4357,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5473
4357
|
"default": {}
|
|
5474
4358
|
}`;
|
|
5475
4359
|
|
|
5476
|
-
const { Core: Core$5, Schema: Schema$5 } = lib$
|
|
4360
|
+
const { Core: Core$5, Schema: Schema$5 } = lib$1;
|
|
5477
4361
|
const keywords$4 = keywords$5;
|
|
5478
4362
|
const metaSchema$4 = schema$4;
|
|
5479
4363
|
|
|
@@ -5675,7 +4559,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5675
4559
|
"default": {}
|
|
5676
4560
|
}`;
|
|
5677
4561
|
|
|
5678
|
-
const { Core: Core$4, Schema: Schema$4 } = lib$
|
|
4562
|
+
const { Core: Core$4, Schema: Schema$4 } = lib$1;
|
|
5679
4563
|
const keywords$3 = keywords$5;
|
|
5680
4564
|
const metaSchema$3 = schema$3;
|
|
5681
4565
|
|
|
@@ -5707,11 +4591,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5707
4591
|
"format": keywords$3.metaData,
|
|
5708
4592
|
"items": keywords$3.items,
|
|
5709
4593
|
"maxItems": keywords$3.maxItems,
|
|
5710
|
-
"maxLength": keywords$3.
|
|
4594
|
+
"maxLength": keywords$3.maxLength,
|
|
5711
4595
|
"maxProperties": keywords$3.maxProperties,
|
|
5712
4596
|
"maximum": keywords$3.maximum,
|
|
5713
4597
|
"minItems": keywords$3.minItems,
|
|
5714
|
-
"minLength": keywords$3.
|
|
4598
|
+
"minLength": keywords$3.minLength,
|
|
5715
4599
|
"minProperties": keywords$3.minProperties,
|
|
5716
4600
|
"minimum": keywords$3.minimum,
|
|
5717
4601
|
"multipleOf": keywords$3.multipleOf,
|
|
@@ -5900,7 +4784,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5900
4784
|
"default": true
|
|
5901
4785
|
}`;
|
|
5902
4786
|
|
|
5903
|
-
const { Core: Core$3, Schema: Schema$3 } = lib$
|
|
4787
|
+
const { Core: Core$3, Schema: Schema$3 } = lib$1;
|
|
5904
4788
|
const keywords$2 = keywords$5;
|
|
5905
4789
|
const metaSchema$2 = schema$2;
|
|
5906
4790
|
|
|
@@ -5934,11 +4818,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5934
4818
|
"else": keywords$2.else,
|
|
5935
4819
|
"items": keywords$2.items,
|
|
5936
4820
|
"maxItems": keywords$2.maxItems,
|
|
5937
|
-
"maxLength": keywords$2.
|
|
4821
|
+
"maxLength": keywords$2.maxLength,
|
|
5938
4822
|
"maxProperties": keywords$2.maxProperties,
|
|
5939
4823
|
"maximum": keywords$2.maximum,
|
|
5940
4824
|
"minItems": keywords$2.minItems,
|
|
5941
|
-
"minLength": keywords$2.
|
|
4825
|
+
"minLength": keywords$2.minLength,
|
|
5942
4826
|
"minProperties": keywords$2.minProperties,
|
|
5943
4827
|
"minimum": keywords$2.minimum,
|
|
5944
4828
|
"multipleOf": keywords$2.multipleOf,
|
|
@@ -6283,7 +5167,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6283
5167
|
}
|
|
6284
5168
|
}`;
|
|
6285
5169
|
|
|
6286
|
-
const { Core: Core$2, Schema: Schema$2 } = lib$
|
|
5170
|
+
const { Core: Core$2, Schema: Schema$2 } = lib$1;
|
|
6287
5171
|
const keywords$1 = keywords$5;
|
|
6288
5172
|
const metaSchema$1 = schema$1;
|
|
6289
5173
|
const coreMetaSchema$1 = core$1;
|
|
@@ -6342,11 +5226,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6342
5226
|
"exclusiveMaximum": keywords$1.exclusiveMaximum,
|
|
6343
5227
|
"exclusiveMinimum": keywords$1.exclusiveMinimum,
|
|
6344
5228
|
"maxItems": keywords$1.maxItems,
|
|
6345
|
-
"maxLength": keywords$1.
|
|
5229
|
+
"maxLength": keywords$1.maxLength,
|
|
6346
5230
|
"maxProperties": keywords$1.maxProperties,
|
|
6347
5231
|
"maximum": keywords$1.maximum,
|
|
6348
5232
|
"minItems": keywords$1.minItems,
|
|
6349
|
-
"minLength": keywords$1.
|
|
5233
|
+
"minLength": keywords$1.minLength,
|
|
6350
5234
|
"minProperties": keywords$1.minProperties,
|
|
6351
5235
|
"minimum": keywords$1.minimum,
|
|
6352
5236
|
"multipleOf": keywords$1.multipleOf,
|
|
@@ -6730,7 +5614,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6730
5614
|
}
|
|
6731
5615
|
}`;
|
|
6732
5616
|
|
|
6733
|
-
const { Core: Core$1, Schema: Schema$1 } = lib$
|
|
5617
|
+
const { Core: Core$1, Schema: Schema$1 } = lib$1;
|
|
6734
5618
|
const keywords = keywords$5;
|
|
6735
5619
|
const metaSchema = schema;
|
|
6736
5620
|
const coreMetaSchema = core;
|
|
@@ -6789,11 +5673,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6789
5673
|
"exclusiveMaximum": keywords.exclusiveMaximum,
|
|
6790
5674
|
"exclusiveMinimum": keywords.exclusiveMinimum,
|
|
6791
5675
|
"maxItems": keywords.maxItems,
|
|
6792
|
-
"maxLength": keywords.
|
|
5676
|
+
"maxLength": keywords.maxLength,
|
|
6793
5677
|
"maxProperties": keywords.maxProperties,
|
|
6794
5678
|
"maximum": keywords.maximum,
|
|
6795
5679
|
"minItems": keywords.minItems,
|
|
6796
|
-
"minLength": keywords.
|
|
5680
|
+
"minLength": keywords.minLength,
|
|
6797
5681
|
"minProperties": keywords.minProperties,
|
|
6798
5682
|
"minimum": keywords.minimum,
|
|
6799
5683
|
"multipleOf": keywords.multipleOf,
|
|
@@ -6834,7 +5718,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6834
5718
|
"unevaluatedProperties": keywords.unevaluatedProperties
|
|
6835
5719
|
});
|
|
6836
5720
|
|
|
6837
|
-
const { Core, Schema, InvalidSchemaError } = lib$
|
|
5721
|
+
const { Core, Schema, InvalidSchemaError } = lib$1;
|
|
6838
5722
|
const Keywords = keywords$5;
|
|
6839
5723
|
|
|
6840
5724
|
|