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