@hyperjump/json-schema 0.23.0 → 0.23.1

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.
@@ -2,7 +2,7 @@ define(['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
 
5
- var justCurryIt = curry$a;
5
+ var justCurryIt$2 = curry$j;
6
6
 
7
7
  /*
8
8
  function add(a, b, c) {
@@ -27,7 +27,7 @@ define(['exports'], (function (exports) { 'use strict';
27
27
  milesToKm(10); // 16.2
28
28
  */
29
29
 
30
- function curry$a(fn, arity) {
30
+ function curry$j(fn, arity) {
31
31
  return function curried() {
32
32
  if (arity == null) {
33
33
  arity = fn.length;
@@ -1898,84 +1898,84 @@ define(['exports'], (function (exports) { 'use strict';
1898
1898
 
1899
1899
  var common$1 = { jsonTypeOf: jsonTypeOf$2, resolveUrl: resolveUrl$3, urlFragment: urlFragment$1, pathRelative: pathRelative$1 };
1900
1900
 
1901
- const curry$9 = justCurryIt;
1901
+ const curry$i = justCurryIt$2;
1902
1902
 
1903
1903
 
1904
- const nil$2 = "";
1904
+ const nil$3 = "";
1905
1905
 
1906
- const compile$P = (pointer) => {
1906
+ const compile$Q = (pointer) => {
1907
1907
  if (pointer.length > 0 && pointer[0] !== "/") {
1908
1908
  throw Error("Invalid JSON Pointer");
1909
1909
  }
1910
1910
 
1911
- return pointer.split("/").slice(1).map(unescape);
1911
+ return pointer.split("/").slice(1).map(unescape$1);
1912
1912
  };
1913
1913
 
1914
- const get$2 = (pointer, value = undefined) => {
1915
- const ptr = compile$P(pointer);
1914
+ const get$3 = (pointer, value = undefined) => {
1915
+ const ptr = compile$Q(pointer);
1916
1916
 
1917
1917
  const fn = (value) => ptr.reduce(([value, pointer], segment) => {
1918
- return [applySegment(value, segment, pointer), append(segment, pointer)];
1918
+ return [applySegment$1(value, segment, pointer), append$1(segment, pointer)];
1919
1919
  }, [value, ""])[0];
1920
1920
 
1921
1921
  return value === undefined ? fn : fn(value);
1922
1922
  };
1923
1923
 
1924
- const set = (pointer, subject = undefined, value = undefined) => {
1925
- const ptr = compile$P(pointer);
1926
- const fn = curry$9((subject, value) => _set(ptr, subject, value, nil$2));
1924
+ const set$1 = (pointer, subject = undefined, value = undefined) => {
1925
+ const ptr = compile$Q(pointer);
1926
+ const fn = curry$i((subject, value) => _set$1(ptr, subject, value, nil$3));
1927
1927
  return subject === undefined ? fn : fn(subject, value);
1928
1928
  };
1929
1929
 
1930
- const _set = (pointer, subject, value, cursor) => {
1930
+ const _set$1 = (pointer, subject, value, cursor) => {
1931
1931
  if (pointer.length === 0) {
1932
1932
  return value;
1933
1933
  } else if (pointer.length > 1) {
1934
1934
  const segment = pointer.shift();
1935
- return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
1935
+ return { ...subject, [segment]: _set$1(pointer, applySegment$1(subject, segment, cursor), value, append$1(segment, cursor)) };
1936
1936
  } else if (Array.isArray(subject)) {
1937
1937
  const clonedSubject = [...subject];
1938
- const segment = computeSegment(subject, pointer[0]);
1938
+ const segment = computeSegment$1(subject, pointer[0]);
1939
1939
  clonedSubject[segment] = value;
1940
1940
  return clonedSubject;
1941
1941
  } else if (typeof subject === "object" && subject !== null) {
1942
1942
  return { ...subject, [pointer[0]]: value };
1943
1943
  } else {
1944
- return applySegment(subject, pointer[0], cursor);
1944
+ return applySegment$1(subject, pointer[0], cursor);
1945
1945
  }
1946
1946
  };
1947
1947
 
1948
- const assign = (pointer, subject = undefined, value = undefined) => {
1949
- const ptr = compile$P(pointer);
1950
- const fn = curry$9((subject, value) => _assign(ptr, subject, value, nil$2));
1948
+ const assign$1 = (pointer, subject = undefined, value = undefined) => {
1949
+ const ptr = compile$Q(pointer);
1950
+ const fn = curry$i((subject, value) => _assign$1(ptr, subject, value, nil$3));
1951
1951
  return subject === undefined ? fn : fn(subject, value);
1952
1952
  };
1953
1953
 
1954
- const _assign = (pointer, subject, value, cursor) => {
1954
+ const _assign$1 = (pointer, subject, value, cursor) => {
1955
1955
  if (pointer.length === 0) {
1956
1956
  return;
1957
- } else if (pointer.length === 1 && !isScalar(subject)) {
1958
- const segment = computeSegment(subject, pointer[0]);
1957
+ } else if (pointer.length === 1 && !isScalar$1(subject)) {
1958
+ const segment = computeSegment$1(subject, pointer[0]);
1959
1959
  subject[segment] = value;
1960
1960
  } else {
1961
1961
  const segment = pointer.shift();
1962
- _assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
1962
+ _assign$1(pointer, applySegment$1(subject, segment, cursor), value, append$1(segment, cursor));
1963
1963
  }
1964
1964
  };
1965
1965
 
1966
- const unset = (pointer, subject = undefined) => {
1967
- const ptr = compile$P(pointer);
1968
- const fn = (subject) => _unset(ptr, subject, nil$2);
1966
+ const unset$1 = (pointer, subject = undefined) => {
1967
+ const ptr = compile$Q(pointer);
1968
+ const fn = (subject) => _unset$1(ptr, subject, nil$3);
1969
1969
  return subject === undefined ? fn : fn(subject);
1970
1970
  };
1971
1971
 
1972
- const _unset = (pointer, subject, cursor) => {
1972
+ const _unset$1 = (pointer, subject, cursor) => {
1973
1973
  if (pointer.length == 0) {
1974
1974
  return undefined;
1975
1975
  } else if (pointer.length > 1) {
1976
1976
  const segment = pointer.shift();
1977
- const value = applySegment(subject, segment, cursor);
1978
- return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
1977
+ const value = applySegment$1(subject, segment, cursor);
1978
+ return { ...subject, [segment]: _unset$1(pointer, value, append$1(segment, cursor)) };
1979
1979
  } else if (Array.isArray(subject)) {
1980
1980
  return subject.filter((_, ndx) => ndx != pointer[0]);
1981
1981
  } else if (typeof subject === "object" && subject !== null) {
@@ -1983,54 +1983,54 @@ define(['exports'], (function (exports) { 'use strict';
1983
1983
  const { [pointer[0]]: _, ...result } = subject;
1984
1984
  return result;
1985
1985
  } else {
1986
- return applySegment(subject, pointer[0], cursor);
1986
+ return applySegment$1(subject, pointer[0], cursor);
1987
1987
  }
1988
1988
  };
1989
1989
 
1990
- const remove = (pointer, subject = undefined) => {
1991
- const ptr = compile$P(pointer);
1992
- const fn = (subject) => _remove(ptr, subject, nil$2);
1990
+ const remove$1 = (pointer, subject = undefined) => {
1991
+ const ptr = compile$Q(pointer);
1992
+ const fn = (subject) => _remove$1(ptr, subject, nil$3);
1993
1993
  return subject === undefined ? fn : fn(subject);
1994
1994
  };
1995
1995
 
1996
- const _remove = (pointer, subject, cursor) => {
1996
+ const _remove$1 = (pointer, subject, cursor) => {
1997
1997
  if (pointer.length === 0) {
1998
1998
  return;
1999
1999
  } else if (pointer.length > 1) {
2000
2000
  const segment = pointer.shift();
2001
- const value = applySegment(subject, segment, cursor);
2002
- _remove(pointer, value, append(segment, cursor));
2001
+ const value = applySegment$1(subject, segment, cursor);
2002
+ _remove$1(pointer, value, append$1(segment, cursor));
2003
2003
  } else if (Array.isArray(subject)) {
2004
2004
  subject.splice(pointer[0], 1);
2005
2005
  } else if (typeof subject === "object" && subject !== null) {
2006
2006
  delete subject[pointer[0]];
2007
2007
  } else {
2008
- applySegment(subject, pointer[0], cursor);
2008
+ applySegment$1(subject, pointer[0], cursor);
2009
2009
  }
2010
2010
  };
2011
2011
 
2012
- const append = curry$9((segment, pointer) => pointer + "/" + escape(segment));
2012
+ const append$1 = curry$i((segment, pointer) => pointer + "/" + escape$2(segment));
2013
2013
 
2014
- const escape = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
2015
- const unescape = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
2016
- const computeSegment = (value, segment) => Array.isArray(value) && segment === "-" ? value.length : segment;
2014
+ const escape$2 = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
2015
+ const unescape$1 = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
2016
+ const computeSegment$1 = (value, segment) => Array.isArray(value) && segment === "-" ? value.length : segment;
2017
2017
 
2018
- const applySegment = (value, segment, cursor = "") => {
2018
+ const applySegment$1 = (value, segment, cursor = "") => {
2019
2019
  if (value === undefined) {
2020
2020
  throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
2021
2021
  } else if (value === null) {
2022
2022
  throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
2023
- } else if (isScalar(value)) {
2023
+ } else if (isScalar$1(value)) {
2024
2024
  throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
2025
2025
  } else {
2026
- const computedSegment = computeSegment(value, segment);
2026
+ const computedSegment = computeSegment$1(value, segment);
2027
2027
  return value[computedSegment];
2028
2028
  }
2029
2029
  };
2030
2030
 
2031
- const isScalar = (value) => value === null || typeof value !== "object";
2031
+ const isScalar$1 = (value) => value === null || typeof value !== "object";
2032
2032
 
2033
- var lib$3 = { nil: nil$2, append, get: get$2, set, assign, unset, remove };
2033
+ var lib$6 = { nil: nil$3, append: append$1, get: get$3, set: set$1, assign: assign$1, unset: unset$1, remove: remove$1 };
2034
2034
 
2035
2035
  const $__value = Symbol("$__value");
2036
2036
  const $__href = Symbol("$__href");
@@ -2046,16 +2046,16 @@ define(['exports'], (function (exports) { 'use strict';
2046
2046
 
2047
2047
  var reference = { cons: cons$1, isReference, href, value: value$2 };
2048
2048
 
2049
- const JsonPointer$1 = lib$3;
2050
- const curry$8 = justCurryIt;
2049
+ const JsonPointer$3 = lib$6;
2050
+ const curry$h = justCurryIt$2;
2051
2051
  const { resolveUrl: resolveUrl$2, jsonTypeOf: jsonTypeOf$1 } = common$1;
2052
2052
  const Reference$2 = reference;
2053
2053
 
2054
2054
 
2055
- const nil$1 = Object.freeze({ id: "", pointer: "", instance: undefined, value: undefined });
2056
- const cons = (instance, id = "") => Object.freeze({ ...nil$1, id: resolveUrl$2(id, ""), instance, value: instance });
2055
+ const nil$2 = Object.freeze({ id: "", pointer: "", instance: undefined, value: undefined });
2056
+ const cons = (instance, id = "") => Object.freeze({ ...nil$2, id: resolveUrl$2(id, ""), instance, value: instance });
2057
2057
 
2058
- const get$1 = (url, instance = nil$1) => {
2058
+ const get$2 = (url, instance = nil$2) => {
2059
2059
  if (!url.startsWith("#")) {
2060
2060
  throw Error(`No JSON document found at '${url.split("#")[0]}'`);
2061
2061
  }
@@ -2066,252 +2066,1275 @@ define(['exports'], (function (exports) { 'use strict';
2066
2066
  const uri$1 = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
2067
2067
  const value$1 = (doc) => Reference$2.isReference(doc.value) ? Reference$2.value(doc.value) : doc.value;
2068
2068
  const has$1 = (key, doc) => key in value$1(doc);
2069
- const typeOf$1 = curry$8((doc, type) => jsonTypeOf$1(value$1(doc), type));
2069
+ const typeOf$1 = curry$h((doc, type) => jsonTypeOf$1(value$1(doc), type));
2070
2070
 
2071
2071
  const step$1 = (key, doc) => Object.freeze({
2072
2072
  ...doc,
2073
- pointer: JsonPointer$1.append(key, doc.pointer),
2073
+ pointer: JsonPointer$3.append(key, doc.pointer),
2074
2074
  value: value$1(doc)[key]
2075
2075
  });
2076
2076
 
2077
- const entries$3 = (doc) => Object.keys(value$1(doc))
2077
+ const entries$5 = (doc) => Object.keys(value$1(doc))
2078
2078
  .map((key) => [key, step$1(key, doc)]);
2079
2079
 
2080
2080
  const keys$1 = (doc) => Object.keys(value$1(doc));
2081
2081
 
2082
- const map$4 = curry$8((fn, doc) => value$1(doc)
2082
+ const map$7 = curry$h((fn, doc) => value$1(doc)
2083
2083
  .map((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
2084
2084
 
2085
- const forEach = curry$8((fn, doc) => value$1(doc)
2085
+ const forEach = curry$h((fn, doc) => value$1(doc)
2086
2086
  .forEach((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
2087
2087
 
2088
- const filter$1 = curry$8((fn, doc) => value$1(doc)
2088
+ const filter$2 = curry$h((fn, doc) => value$1(doc)
2089
2089
  .map((item, ndx, array, thisArg) => step$1(ndx, doc))
2090
2090
  .filter((item, ndx, array, thisArg) => fn(item, ndx, array, thisArg)));
2091
2091
 
2092
- const reduce$3 = curry$8((fn, acc, doc) => value$1(doc)
2092
+ const reduce$6 = curry$h((fn, acc, doc) => value$1(doc)
2093
2093
  .reduce((acc, item, ndx) => fn(acc, step$1(ndx, doc), ndx), acc));
2094
2094
 
2095
- const every$1 = curry$8((fn, doc) => value$1(doc)
2095
+ const every$2 = curry$h((fn, doc) => value$1(doc)
2096
2096
  .every((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
2097
2097
 
2098
- const some$1 = curry$8((fn, doc) => value$1(doc)
2098
+ const some$2 = curry$h((fn, doc) => value$1(doc)
2099
2099
  .some((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
2100
2100
 
2101
2101
  const length$1 = (doc) => value$1(doc).length;
2102
2102
 
2103
2103
  var instance = {
2104
- nil: nil$1, cons, get: get$1, uri: uri$1, value: value$1, has: has$1, typeOf: typeOf$1, length: length$1,
2105
- 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
2104
+ nil: nil$2, cons, get: get$2, uri: uri$1, value: value$1, has: has$1, typeOf: typeOf$1, length: length$1,
2105
+ step: step$1, entries: entries$5, keys: keys$1, map: map$7, forEach, filter: filter$2, reduce: reduce$6, every: every$2, some: some$2
2106
2106
  };
2107
2107
 
2108
- var entries$2 = async (doc) => Object.entries(await doc);
2108
+ var entries$4 = async (doc) => Object.entries(await doc);
2109
2109
 
2110
- const curry$7 = justCurryIt;
2110
+ const curry$g = justCurryIt$2;
2111
2111
 
2112
2112
 
2113
- var map$3 = curry$7(async (fn, doc) => (await doc).map(fn));
2113
+ var map$6 = curry$g(async (fn, doc) => (await doc).map(fn));
2114
2114
 
2115
- const curry$6 = justCurryIt;
2115
+ const curry$f = justCurryIt$2;
2116
2116
 
2117
2117
 
2118
- var reduce$2 = curry$6(async (fn, acc, doc) => {
2118
+ var reduce$5 = curry$f(async (fn, acc, doc) => {
2119
2119
  return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
2120
2120
  });
2121
2121
 
2122
- const curry$5 = justCurryIt;
2123
- const reduce$1 = reduce$2;
2122
+ const curry$e = justCurryIt$2;
2123
+ const reduce$4 = reduce$5;
2124
2124
 
2125
2125
 
2126
- var filter = curry$5(async (fn, doc, options = {}) => {
2127
- return reduce$1(async (acc, item) => {
2126
+ var filter$1 = curry$e(async (fn, doc, options = {}) => {
2127
+ return reduce$4(async (acc, item) => {
2128
2128
  return (await fn(item)) ? acc.concat([item]) : acc;
2129
2129
  }, [], doc, options);
2130
2130
  });
2131
2131
 
2132
- const curry$4 = justCurryIt;
2133
- const map$2 = map$3;
2132
+ const curry$d = justCurryIt$2;
2133
+ const map$5 = map$6;
2134
2134
 
2135
2135
 
2136
- var some = curry$4(async (fn, doc) => {
2137
- const results = await map$2(fn, doc);
2136
+ var some$1 = curry$d(async (fn, doc) => {
2137
+ const results = await map$5(fn, doc);
2138
2138
  return (await Promise.all(results))
2139
2139
  .some((a) => a);
2140
2140
  });
2141
2141
 
2142
- const curry$3 = justCurryIt;
2143
- const map$1 = map$3;
2142
+ const curry$c = justCurryIt$2;
2143
+ const map$4 = map$6;
2144
2144
 
2145
2145
 
2146
- var every = curry$3(async (fn, doc) => {
2147
- const results = await map$1(fn, doc);
2146
+ var every$1 = curry$c(async (fn, doc) => {
2147
+ const results = await map$4(fn, doc);
2148
2148
  return (await Promise.all(results))
2149
2149
  .every((a) => a);
2150
2150
  });
2151
2151
 
2152
- const curry$2 = justCurryIt;
2152
+ const curry$b = justCurryIt$2;
2153
2153
 
2154
2154
 
2155
- var pipeline$1 = curry$2((fns, doc) => {
2155
+ var pipeline$3 = curry$b((fns, doc) => {
2156
2156
  return fns.reduce(async (acc, fn) => fn(await acc), doc);
2157
2157
  });
2158
2158
 
2159
- var all = (doc) => Promise.all(doc);
2159
+ var all$1 = (doc) => Promise.all(doc);
2160
2160
 
2161
- const pipeline = pipeline$1;
2162
- const entries$1 = entries$2;
2163
- const reduce = reduce$2;
2161
+ const pipeline$2 = pipeline$3;
2162
+ const entries$3 = entries$4;
2163
+ const reduce$3 = reduce$5;
2164
2164
 
2165
2165
 
2166
- var allValues = (doc) => {
2167
- return pipeline([
2168
- entries$1,
2169
- reduce(async (acc, [propertyName, propertyValue]) => {
2166
+ var allValues$1 = (doc) => {
2167
+ return pipeline$2([
2168
+ entries$3,
2169
+ reduce$3(async (acc, [propertyName, propertyValue]) => {
2170
2170
  acc[propertyName] = await propertyValue;
2171
2171
  return acc;
2172
2172
  }, {})
2173
2173
  ], doc);
2174
2174
  };
2175
2175
 
2176
- var lib$2 = {
2177
- entries: entries$2,
2178
- map: map$3,
2179
- filter: filter,
2180
- reduce: reduce$2,
2181
- some: some,
2182
- every: every,
2183
- pipeline: pipeline$1,
2184
- all: all,
2185
- allValues: allValues
2176
+ var lib$5 = {
2177
+ entries: entries$4,
2178
+ map: map$6,
2179
+ filter: filter$1,
2180
+ reduce: reduce$5,
2181
+ some: some$1,
2182
+ every: every$1,
2183
+ pipeline: pipeline$3,
2184
+ all: all$1,
2185
+ allValues: allValues$1
2186
2186
  };
2187
2187
 
2188
- var fetch_browser = fetch;
2189
-
2190
- var contentType = {};
2191
-
2192
- /*!
2193
- * content-type
2194
- * Copyright(c) 2015 Douglas Christopher Wilson
2195
- * MIT Licensed
2196
- */
2188
+ var justCurryIt$1 = curry$a;
2197
2189
 
2198
- /**
2199
- * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
2200
- *
2201
- * parameter = token "=" ( token / quoted-string )
2202
- * token = 1*tchar
2203
- * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
2204
- * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
2205
- * / DIGIT / ALPHA
2206
- * ; any VCHAR, except delimiters
2207
- * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
2208
- * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
2209
- * obs-text = %x80-FF
2210
- * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
2211
- */
2212
- var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
2213
- var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
2214
- var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
2190
+ /*
2191
+ function add(a, b, c) {
2192
+ return a + b + c;
2193
+ }
2194
+ curry(add)(1)(2)(3); // 6
2195
+ curry(add)(1)(2)(2); // 5
2196
+ curry(add)(2)(4, 3); // 9
2215
2197
 
2216
- /**
2217
- * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
2218
- *
2219
- * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
2220
- * obs-text = %x80-FF
2221
- */
2222
- var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
2198
+ function add(...args) {
2199
+ return args.reduce((sum, n) => sum + n, 0)
2200
+ }
2201
+ var curryAdd4 = curry(add, 4)
2202
+ curryAdd4(1)(2, 3)(4); // 10
2223
2203
 
2224
- /**
2225
- * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
2226
- */
2227
- var QUOTE_REGEXP = /([\\"])/g;
2204
+ function converter(ratio, input) {
2205
+ return (input*ratio).toFixed(1);
2206
+ }
2207
+ const curriedConverter = curry(converter)
2208
+ const milesToKm = curriedConverter(1.62);
2209
+ milesToKm(35); // 56.7
2210
+ milesToKm(10); // 16.2
2211
+ */
2228
2212
 
2229
- /**
2230
- * RegExp to match type in RFC 7231 sec 3.1.1.1
2231
- *
2232
- * media-type = type "/" subtype
2233
- * type = token
2234
- * subtype = token
2235
- */
2236
- var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
2213
+ function curry$a(fn, arity) {
2214
+ return function curried() {
2215
+ if (arity == null) {
2216
+ arity = fn.length;
2217
+ }
2218
+ var args = [].slice.call(arguments);
2219
+ if (args.length >= arity) {
2220
+ return fn.apply(this, args);
2221
+ } else {
2222
+ return function() {
2223
+ return curried.apply(this, args.concat([].slice.call(arguments)));
2224
+ };
2225
+ }
2226
+ };
2227
+ }
2237
2228
 
2238
- /**
2239
- * Module exports.
2240
- * @public
2241
- */
2229
+ const curry$9 = justCurryIt$1;
2242
2230
 
2243
- contentType.format = format$1;
2244
- contentType.parse = parse$1;
2245
2231
 
2246
- /**
2247
- * Format object to media type.
2248
- *
2249
- * @param {object} obj
2250
- * @return {string}
2251
- * @public
2252
- */
2232
+ const nil$1 = "";
2253
2233
 
2254
- function format$1 (obj) {
2255
- if (!obj || typeof obj !== 'object') {
2256
- throw new TypeError('argument obj is required')
2234
+ const compile$P = (pointer) => {
2235
+ if (pointer.length > 0 && pointer[0] !== "/") {
2236
+ throw Error("Invalid JSON Pointer");
2257
2237
  }
2258
2238
 
2259
- var parameters = obj.parameters;
2260
- var type = obj.type;
2261
-
2262
- if (!type || !TYPE_REGEXP.test(type)) {
2263
- throw new TypeError('invalid type')
2264
- }
2239
+ return pointer.split("/").slice(1).map(unescape);
2240
+ };
2265
2241
 
2266
- var string = type;
2242
+ const get$1 = (pointer, value = undefined) => {
2243
+ const ptr = compile$P(pointer);
2267
2244
 
2268
- // append parameters
2269
- if (parameters && typeof parameters === 'object') {
2270
- var param;
2271
- var params = Object.keys(parameters).sort();
2245
+ const fn = (value) => ptr.reduce(([value, pointer], segment) => {
2246
+ return [applySegment(value, segment, pointer), append(segment, pointer)];
2247
+ }, [value, ""])[0];
2272
2248
 
2273
- for (var i = 0; i < params.length; i++) {
2274
- param = params[i];
2249
+ return value === undefined ? fn : fn(value);
2250
+ };
2275
2251
 
2276
- if (!TOKEN_REGEXP.test(param)) {
2277
- throw new TypeError('invalid parameter name')
2278
- }
2252
+ const set = (pointer, subject = undefined, value = undefined) => {
2253
+ const ptr = compile$P(pointer);
2254
+ const fn = curry$9((subject, value) => _set(ptr, subject, value, nil$1));
2255
+ return subject === undefined ? fn : fn(subject, value);
2256
+ };
2279
2257
 
2280
- string += '; ' + param + '=' + qstring(parameters[param]);
2258
+ const _set = (pointer, subject, value, cursor) => {
2259
+ if (pointer.length === 0) {
2260
+ return value;
2261
+ } else if (pointer.length > 1) {
2262
+ if (Array.isArray(subject)) {
2263
+ const index = pointer.shift();
2264
+ const clonedSubject = [...subject];
2265
+ clonedSubject[index] = _set(pointer, applySegment(subject, index, cursor), value, append(index, cursor));
2266
+ return clonedSubject;
2267
+ } else {
2268
+ const segment = pointer.shift();
2269
+ return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
2281
2270
  }
2271
+ } else if (Array.isArray(subject)) {
2272
+ const clonedSubject = [...subject];
2273
+ const segment = computeSegment(subject, pointer[0]);
2274
+ clonedSubject[segment] = value;
2275
+ return clonedSubject;
2276
+ } else if (typeof subject === "object" && subject !== null) {
2277
+ return { ...subject, [pointer[0]]: value };
2278
+ } else {
2279
+ return applySegment(subject, pointer[0], cursor);
2282
2280
  }
2281
+ };
2283
2282
 
2284
- return string
2285
- }
2286
-
2287
- /**
2288
- * Parse media type to object.
2289
- *
2290
- * @param {string|object} string
2291
- * @return {Object}
2292
- * @public
2293
- */
2283
+ const assign = (pointer, subject = undefined, value = undefined) => {
2284
+ const ptr = compile$P(pointer);
2285
+ const fn = curry$9((subject, value) => _assign(ptr, subject, value, nil$1));
2286
+ return subject === undefined ? fn : fn(subject, value);
2287
+ };
2294
2288
 
2295
- function parse$1 (string) {
2296
- if (!string) {
2297
- throw new TypeError('argument string is required')
2289
+ const _assign = (pointer, subject, value, cursor) => {
2290
+ if (pointer.length === 0) {
2291
+ return;
2292
+ } else if (pointer.length === 1 && !isScalar(subject)) {
2293
+ const segment = computeSegment(subject, pointer[0]);
2294
+ subject[segment] = value;
2295
+ } else {
2296
+ const segment = pointer.shift();
2297
+ _assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
2298
2298
  }
2299
+ };
2299
2300
 
2300
- // support req/res-like objects as argument
2301
- var header = typeof string === 'object'
2302
- ? getcontenttype(string)
2303
- : string;
2301
+ const unset = (pointer, subject = undefined) => {
2302
+ const ptr = compile$P(pointer);
2303
+ const fn = (subject) => _unset(ptr, subject, nil$1);
2304
+ return subject === undefined ? fn : fn(subject);
2305
+ };
2304
2306
 
2305
- if (typeof header !== 'string') {
2306
- throw new TypeError('argument string is required to be a string')
2307
+ const _unset = (pointer, subject, cursor) => {
2308
+ if (pointer.length == 0) {
2309
+ return undefined;
2310
+ } else if (pointer.length > 1) {
2311
+ const segment = pointer.shift();
2312
+ const value = applySegment(subject, segment, cursor);
2313
+ return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
2314
+ } else if (Array.isArray(subject)) {
2315
+ return subject.filter((_, ndx) => ndx != pointer[0]);
2316
+ } else if (typeof subject === "object" && subject !== null) {
2317
+ // eslint-disable-next-line no-unused-vars
2318
+ const { [pointer[0]]: _, ...result } = subject;
2319
+ return result;
2320
+ } else {
2321
+ return applySegment(subject, pointer[0], cursor);
2307
2322
  }
2323
+ };
2308
2324
 
2309
- var index = header.indexOf(';');
2310
- var type = index !== -1
2311
- ? header.substr(0, index).trim()
2312
- : header.trim();
2313
-
2314
- if (!TYPE_REGEXP.test(type)) {
2325
+ const remove = (pointer, subject = undefined) => {
2326
+ const ptr = compile$P(pointer);
2327
+ const fn = (subject) => _remove(ptr, subject, nil$1);
2328
+ return subject === undefined ? fn : fn(subject);
2329
+ };
2330
+
2331
+ const _remove = (pointer, subject, cursor) => {
2332
+ if (pointer.length === 0) {
2333
+ return;
2334
+ } else if (pointer.length > 1) {
2335
+ const segment = pointer.shift();
2336
+ const value = applySegment(subject, segment, cursor);
2337
+ _remove(pointer, value, append(segment, cursor));
2338
+ } else if (Array.isArray(subject)) {
2339
+ subject.splice(pointer[0], 1);
2340
+ } else if (typeof subject === "object" && subject !== null) {
2341
+ delete subject[pointer[0]];
2342
+ } else {
2343
+ applySegment(subject, pointer[0], cursor);
2344
+ }
2345
+ };
2346
+
2347
+ const append = curry$9((segment, pointer) => pointer + "/" + escape$1(segment));
2348
+
2349
+ const escape$1 = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
2350
+ const unescape = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
2351
+ const computeSegment = (value, segment) => Array.isArray(value) && segment === "-" ? value.length : segment;
2352
+
2353
+ const applySegment = (value, segment, cursor = "") => {
2354
+ if (value === undefined) {
2355
+ throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
2356
+ } else if (value === null) {
2357
+ throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
2358
+ } else if (isScalar(value)) {
2359
+ throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
2360
+ } else {
2361
+ const computedSegment = computeSegment(value, segment);
2362
+ return value[computedSegment];
2363
+ }
2364
+ };
2365
+
2366
+ const isScalar = (value) => value === null || typeof value !== "object";
2367
+
2368
+ var lib$4 = { nil: nil$1, append, get: get$1, set, assign, unset, remove };
2369
+
2370
+ var moo$1 = {exports: {}};
2371
+
2372
+ (function (module) {
2373
+ (function(root, factory) {
2374
+ if (module.exports) {
2375
+ module.exports = factory();
2376
+ } else {
2377
+ root.moo = factory();
2378
+ }
2379
+ }(commonjsGlobal, function() {
2380
+
2381
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
2382
+ var toString = Object.prototype.toString;
2383
+ var hasSticky = typeof new RegExp().sticky === 'boolean';
2384
+
2385
+ /***************************************************************************/
2386
+
2387
+ function isRegExp(o) { return o && toString.call(o) === '[object RegExp]' }
2388
+ function isObject(o) { return o && typeof o === 'object' && !isRegExp(o) && !Array.isArray(o) }
2389
+
2390
+ function reEscape(s) {
2391
+ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')
2392
+ }
2393
+ function reGroups(s) {
2394
+ var re = new RegExp('|' + s);
2395
+ return re.exec('').length - 1
2396
+ }
2397
+ function reCapture(s) {
2398
+ return '(' + s + ')'
2399
+ }
2400
+ function reUnion(regexps) {
2401
+ if (!regexps.length) return '(?!)'
2402
+ var source = regexps.map(function(s) {
2403
+ return "(?:" + s + ")"
2404
+ }).join('|');
2405
+ return "(?:" + source + ")"
2406
+ }
2407
+
2408
+ function regexpOrLiteral(obj) {
2409
+ if (typeof obj === 'string') {
2410
+ return '(?:' + reEscape(obj) + ')'
2411
+
2412
+ } else if (isRegExp(obj)) {
2413
+ // TODO: consider /u support
2414
+ if (obj.ignoreCase) throw new Error('RegExp /i flag not allowed')
2415
+ if (obj.global) throw new Error('RegExp /g flag is implied')
2416
+ if (obj.sticky) throw new Error('RegExp /y flag is implied')
2417
+ if (obj.multiline) throw new Error('RegExp /m flag is implied')
2418
+ return obj.source
2419
+
2420
+ } else {
2421
+ throw new Error('Not a pattern: ' + obj)
2422
+ }
2423
+ }
2424
+
2425
+ function objectToRules(object) {
2426
+ var keys = Object.getOwnPropertyNames(object);
2427
+ var result = [];
2428
+ for (var i = 0; i < keys.length; i++) {
2429
+ var key = keys[i];
2430
+ var thing = object[key];
2431
+ var rules = [].concat(thing);
2432
+ if (key === 'include') {
2433
+ for (var j = 0; j < rules.length; j++) {
2434
+ result.push({include: rules[j]});
2435
+ }
2436
+ continue
2437
+ }
2438
+ var match = [];
2439
+ rules.forEach(function(rule) {
2440
+ if (isObject(rule)) {
2441
+ if (match.length) result.push(ruleOptions(key, match));
2442
+ result.push(ruleOptions(key, rule));
2443
+ match = [];
2444
+ } else {
2445
+ match.push(rule);
2446
+ }
2447
+ });
2448
+ if (match.length) result.push(ruleOptions(key, match));
2449
+ }
2450
+ return result
2451
+ }
2452
+
2453
+ function arrayToRules(array) {
2454
+ var result = [];
2455
+ for (var i = 0; i < array.length; i++) {
2456
+ var obj = array[i];
2457
+ if (obj.include) {
2458
+ var include = [].concat(obj.include);
2459
+ for (var j = 0; j < include.length; j++) {
2460
+ result.push({include: include[j]});
2461
+ }
2462
+ continue
2463
+ }
2464
+ if (!obj.type) {
2465
+ throw new Error('Rule has no type: ' + JSON.stringify(obj))
2466
+ }
2467
+ result.push(ruleOptions(obj.type, obj));
2468
+ }
2469
+ return result
2470
+ }
2471
+
2472
+ function ruleOptions(type, obj) {
2473
+ if (!isObject(obj)) {
2474
+ obj = { match: obj };
2475
+ }
2476
+ if (obj.include) {
2477
+ throw new Error('Matching rules cannot also include states')
2478
+ }
2479
+
2480
+ // nb. error and fallback imply lineBreaks
2481
+ var options = {
2482
+ defaultType: type,
2483
+ lineBreaks: !!obj.error || !!obj.fallback,
2484
+ pop: false,
2485
+ next: null,
2486
+ push: null,
2487
+ error: false,
2488
+ fallback: false,
2489
+ value: null,
2490
+ type: null,
2491
+ shouldThrow: false,
2492
+ };
2493
+
2494
+ // Avoid Object.assign(), so we support IE9+
2495
+ for (var key in obj) {
2496
+ if (hasOwnProperty.call(obj, key)) {
2497
+ options[key] = obj[key];
2498
+ }
2499
+ }
2500
+
2501
+ // type transform cannot be a string
2502
+ if (typeof options.type === 'string' && type !== options.type) {
2503
+ throw new Error("Type transform cannot be a string (type '" + options.type + "' for token '" + type + "')")
2504
+ }
2505
+
2506
+ // convert to array
2507
+ var match = options.match;
2508
+ options.match = Array.isArray(match) ? match : match ? [match] : [];
2509
+ options.match.sort(function(a, b) {
2510
+ return isRegExp(a) && isRegExp(b) ? 0
2511
+ : isRegExp(b) ? -1 : isRegExp(a) ? +1 : b.length - a.length
2512
+ });
2513
+ return options
2514
+ }
2515
+
2516
+ function toRules(spec) {
2517
+ return Array.isArray(spec) ? arrayToRules(spec) : objectToRules(spec)
2518
+ }
2519
+
2520
+ var defaultErrorRule = ruleOptions('error', {lineBreaks: true, shouldThrow: true});
2521
+ function compileRules(rules, hasStates) {
2522
+ var errorRule = null;
2523
+ var fast = Object.create(null);
2524
+ var fastAllowed = true;
2525
+ var unicodeFlag = null;
2526
+ var groups = [];
2527
+ var parts = [];
2528
+
2529
+ // If there is a fallback rule, then disable fast matching
2530
+ for (var i = 0; i < rules.length; i++) {
2531
+ if (rules[i].fallback) {
2532
+ fastAllowed = false;
2533
+ }
2534
+ }
2535
+
2536
+ for (var i = 0; i < rules.length; i++) {
2537
+ var options = rules[i];
2538
+
2539
+ if (options.include) {
2540
+ // all valid inclusions are removed by states() preprocessor
2541
+ throw new Error('Inheritance is not allowed in stateless lexers')
2542
+ }
2543
+
2544
+ if (options.error || options.fallback) {
2545
+ // errorRule can only be set once
2546
+ if (errorRule) {
2547
+ if (!options.fallback === !errorRule.fallback) {
2548
+ throw new Error("Multiple " + (options.fallback ? "fallback" : "error") + " rules not allowed (for token '" + options.defaultType + "')")
2549
+ } else {
2550
+ throw new Error("fallback and error are mutually exclusive (for token '" + options.defaultType + "')")
2551
+ }
2552
+ }
2553
+ errorRule = options;
2554
+ }
2555
+
2556
+ var match = options.match.slice();
2557
+ if (fastAllowed) {
2558
+ while (match.length && typeof match[0] === 'string' && match[0].length === 1) {
2559
+ var word = match.shift();
2560
+ fast[word.charCodeAt(0)] = options;
2561
+ }
2562
+ }
2563
+
2564
+ // Warn about inappropriate state-switching options
2565
+ if (options.pop || options.push || options.next) {
2566
+ if (!hasStates) {
2567
+ throw new Error("State-switching options are not allowed in stateless lexers (for token '" + options.defaultType + "')")
2568
+ }
2569
+ if (options.fallback) {
2570
+ throw new Error("State-switching options are not allowed on fallback tokens (for token '" + options.defaultType + "')")
2571
+ }
2572
+ }
2573
+
2574
+ // Only rules with a .match are included in the RegExp
2575
+ if (match.length === 0) {
2576
+ continue
2577
+ }
2578
+ fastAllowed = false;
2579
+
2580
+ groups.push(options);
2581
+
2582
+ // Check unicode flag is used everywhere or nowhere
2583
+ for (var j = 0; j < match.length; j++) {
2584
+ var obj = match[j];
2585
+ if (!isRegExp(obj)) {
2586
+ continue
2587
+ }
2588
+
2589
+ if (unicodeFlag === null) {
2590
+ unicodeFlag = obj.unicode;
2591
+ } else if (unicodeFlag !== obj.unicode && options.fallback === false) {
2592
+ throw new Error('If one rule is /u then all must be')
2593
+ }
2594
+ }
2595
+
2596
+ // convert to RegExp
2597
+ var pat = reUnion(match.map(regexpOrLiteral));
2598
+
2599
+ // validate
2600
+ var regexp = new RegExp(pat);
2601
+ if (regexp.test("")) {
2602
+ throw new Error("RegExp matches empty string: " + regexp)
2603
+ }
2604
+ var groupCount = reGroups(pat);
2605
+ if (groupCount > 0) {
2606
+ throw new Error("RegExp has capture groups: " + regexp + "\nUse (?: … ) instead")
2607
+ }
2608
+
2609
+ // try and detect rules matching newlines
2610
+ if (!options.lineBreaks && regexp.test('\n')) {
2611
+ throw new Error('Rule should declare lineBreaks: ' + regexp)
2612
+ }
2613
+
2614
+ // store regex
2615
+ parts.push(reCapture(pat));
2616
+ }
2617
+
2618
+
2619
+ // If there's no fallback rule, use the sticky flag so we only look for
2620
+ // matches at the current index.
2621
+ //
2622
+ // If we don't support the sticky flag, then fake it using an irrefutable
2623
+ // match (i.e. an empty pattern).
2624
+ var fallbackRule = errorRule && errorRule.fallback;
2625
+ var flags = hasSticky && !fallbackRule ? 'ym' : 'gm';
2626
+ var suffix = hasSticky || fallbackRule ? '' : '|';
2627
+
2628
+ if (unicodeFlag === true) flags += "u";
2629
+ var combined = new RegExp(reUnion(parts) + suffix, flags);
2630
+ return {regexp: combined, groups: groups, fast: fast, error: errorRule || defaultErrorRule}
2631
+ }
2632
+
2633
+ function compile(rules) {
2634
+ var result = compileRules(toRules(rules));
2635
+ return new Lexer({start: result}, 'start')
2636
+ }
2637
+
2638
+ function checkStateGroup(g, name, map) {
2639
+ var state = g && (g.push || g.next);
2640
+ if (state && !map[state]) {
2641
+ throw new Error("Missing state '" + state + "' (in token '" + g.defaultType + "' of state '" + name + "')")
2642
+ }
2643
+ if (g && g.pop && +g.pop !== 1) {
2644
+ throw new Error("pop must be 1 (in token '" + g.defaultType + "' of state '" + name + "')")
2645
+ }
2646
+ }
2647
+ function compileStates(states, start) {
2648
+ var all = states.$all ? toRules(states.$all) : [];
2649
+ delete states.$all;
2650
+
2651
+ var keys = Object.getOwnPropertyNames(states);
2652
+ if (!start) start = keys[0];
2653
+
2654
+ var ruleMap = Object.create(null);
2655
+ for (var i = 0; i < keys.length; i++) {
2656
+ var key = keys[i];
2657
+ ruleMap[key] = toRules(states[key]).concat(all);
2658
+ }
2659
+ for (var i = 0; i < keys.length; i++) {
2660
+ var key = keys[i];
2661
+ var rules = ruleMap[key];
2662
+ var included = Object.create(null);
2663
+ for (var j = 0; j < rules.length; j++) {
2664
+ var rule = rules[j];
2665
+ if (!rule.include) continue
2666
+ var splice = [j, 1];
2667
+ if (rule.include !== key && !included[rule.include]) {
2668
+ included[rule.include] = true;
2669
+ var newRules = ruleMap[rule.include];
2670
+ if (!newRules) {
2671
+ throw new Error("Cannot include nonexistent state '" + rule.include + "' (in state '" + key + "')")
2672
+ }
2673
+ for (var k = 0; k < newRules.length; k++) {
2674
+ var newRule = newRules[k];
2675
+ if (rules.indexOf(newRule) !== -1) continue
2676
+ splice.push(newRule);
2677
+ }
2678
+ }
2679
+ rules.splice.apply(rules, splice);
2680
+ j--;
2681
+ }
2682
+ }
2683
+
2684
+ var map = Object.create(null);
2685
+ for (var i = 0; i < keys.length; i++) {
2686
+ var key = keys[i];
2687
+ map[key] = compileRules(ruleMap[key], true);
2688
+ }
2689
+
2690
+ for (var i = 0; i < keys.length; i++) {
2691
+ var name = keys[i];
2692
+ var state = map[name];
2693
+ var groups = state.groups;
2694
+ for (var j = 0; j < groups.length; j++) {
2695
+ checkStateGroup(groups[j], name, map);
2696
+ }
2697
+ var fastKeys = Object.getOwnPropertyNames(state.fast);
2698
+ for (var j = 0; j < fastKeys.length; j++) {
2699
+ checkStateGroup(state.fast[fastKeys[j]], name, map);
2700
+ }
2701
+ }
2702
+
2703
+ return new Lexer(map, start)
2704
+ }
2705
+
2706
+ function keywordTransform(map) {
2707
+ var reverseMap = Object.create(null);
2708
+ var byLength = Object.create(null);
2709
+ var types = Object.getOwnPropertyNames(map);
2710
+ for (var i = 0; i < types.length; i++) {
2711
+ var tokenType = types[i];
2712
+ var item = map[tokenType];
2713
+ var keywordList = Array.isArray(item) ? item : [item];
2714
+ keywordList.forEach(function(keyword) {
2715
+ (byLength[keyword.length] = byLength[keyword.length] || []).push(keyword);
2716
+ if (typeof keyword !== 'string') {
2717
+ throw new Error("keyword must be string (in keyword '" + tokenType + "')")
2718
+ }
2719
+ reverseMap[keyword] = tokenType;
2720
+ });
2721
+ }
2722
+
2723
+ // fast string lookup
2724
+ // https://jsperf.com/string-lookups
2725
+ function str(x) { return JSON.stringify(x) }
2726
+ var source = '';
2727
+ source += 'switch (value.length) {\n';
2728
+ for (var length in byLength) {
2729
+ var keywords = byLength[length];
2730
+ source += 'case ' + length + ':\n';
2731
+ source += 'switch (value) {\n';
2732
+ keywords.forEach(function(keyword) {
2733
+ var tokenType = reverseMap[keyword];
2734
+ source += 'case ' + str(keyword) + ': return ' + str(tokenType) + '\n';
2735
+ });
2736
+ source += '}\n';
2737
+ }
2738
+ source += '}\n';
2739
+ return Function('value', source) // type
2740
+ }
2741
+
2742
+ /***************************************************************************/
2743
+
2744
+ var Lexer = function(states, state) {
2745
+ this.startState = state;
2746
+ this.states = states;
2747
+ this.buffer = '';
2748
+ this.stack = [];
2749
+ this.reset();
2750
+ };
2751
+
2752
+ Lexer.prototype.reset = function(data, info) {
2753
+ this.buffer = data || '';
2754
+ this.index = 0;
2755
+ this.line = info ? info.line : 1;
2756
+ this.col = info ? info.col : 1;
2757
+ this.queuedToken = info ? info.queuedToken : null;
2758
+ this.queuedThrow = info ? info.queuedThrow : null;
2759
+ this.setState(info ? info.state : this.startState);
2760
+ this.stack = info && info.stack ? info.stack.slice() : [];
2761
+ return this
2762
+ };
2763
+
2764
+ Lexer.prototype.save = function() {
2765
+ return {
2766
+ line: this.line,
2767
+ col: this.col,
2768
+ state: this.state,
2769
+ stack: this.stack.slice(),
2770
+ queuedToken: this.queuedToken,
2771
+ queuedThrow: this.queuedThrow,
2772
+ }
2773
+ };
2774
+
2775
+ Lexer.prototype.setState = function(state) {
2776
+ if (!state || this.state === state) return
2777
+ this.state = state;
2778
+ var info = this.states[state];
2779
+ this.groups = info.groups;
2780
+ this.error = info.error;
2781
+ this.re = info.regexp;
2782
+ this.fast = info.fast;
2783
+ };
2784
+
2785
+ Lexer.prototype.popState = function() {
2786
+ this.setState(this.stack.pop());
2787
+ };
2788
+
2789
+ Lexer.prototype.pushState = function(state) {
2790
+ this.stack.push(this.state);
2791
+ this.setState(state);
2792
+ };
2793
+
2794
+ var eat = hasSticky ? function(re, buffer) { // assume re is /y
2795
+ return re.exec(buffer)
2796
+ } : function(re, buffer) { // assume re is /g
2797
+ var match = re.exec(buffer);
2798
+ // will always match, since we used the |(?:) trick
2799
+ if (match[0].length === 0) {
2800
+ return null
2801
+ }
2802
+ return match
2803
+ };
2804
+
2805
+ Lexer.prototype._getGroup = function(match) {
2806
+ var groupCount = this.groups.length;
2807
+ for (var i = 0; i < groupCount; i++) {
2808
+ if (match[i + 1] !== undefined) {
2809
+ return this.groups[i]
2810
+ }
2811
+ }
2812
+ throw new Error('Cannot find token type for matched text')
2813
+ };
2814
+
2815
+ function tokenToString() {
2816
+ return this.value
2817
+ }
2818
+
2819
+ Lexer.prototype.next = function() {
2820
+ var index = this.index;
2821
+
2822
+ // If a fallback token matched, we don't need to re-run the RegExp
2823
+ if (this.queuedGroup) {
2824
+ var token = this._token(this.queuedGroup, this.queuedText, index);
2825
+ this.queuedGroup = null;
2826
+ this.queuedText = "";
2827
+ return token
2828
+ }
2829
+
2830
+ var buffer = this.buffer;
2831
+ if (index === buffer.length) {
2832
+ return // EOF
2833
+ }
2834
+
2835
+ // Fast matching for single characters
2836
+ var group = this.fast[buffer.charCodeAt(index)];
2837
+ if (group) {
2838
+ return this._token(group, buffer.charAt(index), index)
2839
+ }
2840
+
2841
+ // Execute RegExp
2842
+ var re = this.re;
2843
+ re.lastIndex = index;
2844
+ var match = eat(re, buffer);
2845
+
2846
+ // Error tokens match the remaining buffer
2847
+ var error = this.error;
2848
+ if (match == null) {
2849
+ return this._token(error, buffer.slice(index, buffer.length), index)
2850
+ }
2851
+
2852
+ var group = this._getGroup(match);
2853
+ var text = match[0];
2854
+
2855
+ if (error.fallback && match.index !== index) {
2856
+ this.queuedGroup = group;
2857
+ this.queuedText = text;
2858
+
2859
+ // Fallback tokens contain the unmatched portion of the buffer
2860
+ return this._token(error, buffer.slice(index, match.index), index)
2861
+ }
2862
+
2863
+ return this._token(group, text, index)
2864
+ };
2865
+
2866
+ Lexer.prototype._token = function(group, text, offset) {
2867
+ // count line breaks
2868
+ var lineBreaks = 0;
2869
+ if (group.lineBreaks) {
2870
+ var matchNL = /\n/g;
2871
+ var nl = 1;
2872
+ if (text === '\n') {
2873
+ lineBreaks = 1;
2874
+ } else {
2875
+ while (matchNL.exec(text)) { lineBreaks++; nl = matchNL.lastIndex; }
2876
+ }
2877
+ }
2878
+
2879
+ var token = {
2880
+ type: (typeof group.type === 'function' && group.type(text)) || group.defaultType,
2881
+ value: typeof group.value === 'function' ? group.value(text) : text,
2882
+ text: text,
2883
+ toString: tokenToString,
2884
+ offset: offset,
2885
+ lineBreaks: lineBreaks,
2886
+ line: this.line,
2887
+ col: this.col,
2888
+ };
2889
+ // nb. adding more props to token object will make V8 sad!
2890
+
2891
+ var size = text.length;
2892
+ this.index += size;
2893
+ this.line += lineBreaks;
2894
+ if (lineBreaks !== 0) {
2895
+ this.col = size - nl + 1;
2896
+ } else {
2897
+ this.col += size;
2898
+ }
2899
+
2900
+ // throw, if no rule with {error: true}
2901
+ if (group.shouldThrow) {
2902
+ throw new Error(this.formatError(token, "invalid syntax"))
2903
+ }
2904
+
2905
+ if (group.pop) this.popState();
2906
+ else if (group.push) this.pushState(group.push);
2907
+ else if (group.next) this.setState(group.next);
2908
+
2909
+ return token
2910
+ };
2911
+
2912
+ if (typeof Symbol !== 'undefined' && Symbol.iterator) {
2913
+ var LexerIterator = function(lexer) {
2914
+ this.lexer = lexer;
2915
+ };
2916
+
2917
+ LexerIterator.prototype.next = function() {
2918
+ var token = this.lexer.next();
2919
+ return {value: token, done: !token}
2920
+ };
2921
+
2922
+ LexerIterator.prototype[Symbol.iterator] = function() {
2923
+ return this
2924
+ };
2925
+
2926
+ Lexer.prototype[Symbol.iterator] = function() {
2927
+ return new LexerIterator(this)
2928
+ };
2929
+ }
2930
+
2931
+ Lexer.prototype.formatError = function(token, message) {
2932
+ if (token == null) {
2933
+ // An undefined token indicates EOF
2934
+ var text = this.buffer.slice(this.index);
2935
+ var token = {
2936
+ text: text,
2937
+ offset: this.index,
2938
+ lineBreaks: text.indexOf('\n') === -1 ? 0 : 1,
2939
+ line: this.line,
2940
+ col: this.col,
2941
+ };
2942
+ }
2943
+ var start = Math.max(0, token.offset - token.col + 1);
2944
+ var eol = token.lineBreaks ? token.text.indexOf('\n') : token.text.length;
2945
+ var firstLine = this.buffer.substring(start, token.offset + eol);
2946
+ message += " at line " + token.line + " col " + token.col + ":\n\n";
2947
+ message += " " + firstLine + "\n";
2948
+ message += " " + Array(token.col).join(" ") + "^";
2949
+ return message
2950
+ };
2951
+
2952
+ Lexer.prototype.clone = function() {
2953
+ return new Lexer(this.states, this.state)
2954
+ };
2955
+
2956
+ Lexer.prototype.has = function(tokenType) {
2957
+ return true
2958
+ };
2959
+
2960
+
2961
+ return {
2962
+ compile: compile,
2963
+ states: compileStates,
2964
+ error: Object.freeze({error: true}),
2965
+ fallback: Object.freeze({fallback: true}),
2966
+ keywords: keywordTransform,
2967
+ }
2968
+
2969
+ }));
2970
+ } (moo$1));
2971
+
2972
+ const moo = moo$1.exports;
2973
+
2974
+
2975
+ const digit = `[0-9]`;
2976
+ const digit19 = `[1-9]`;
2977
+ const hexdig = `[0-9a-fA-F]`;
2978
+
2979
+ // String
2980
+ const unescaped = `[\\x20-\\x21\\x23-\\x5b\\x5d-\\u{10ffff}]`;
2981
+ const escape = `\\\\`;
2982
+ const escaped = `${escape}(?:["\\/\\\\brfnt]|u${hexdig}{4})`;
2983
+ const char = `(?:${unescaped}|${escaped})`;
2984
+ const string = `"${char}*"`;
2985
+
2986
+ // Number
2987
+ const int = `(?:0|${digit19}${digit}*)`;
2988
+ const frac = `\\.${digit}+`;
2989
+ const e = `[eE]`;
2990
+ const exp = `${e}[-+]?${digit}+`;
2991
+ const number = `-?${int}(?:${frac})?(?:${exp})?`;
2992
+
2993
+ // Whitespace
2994
+ const whitespace = `(?:(?:\\r?\\n)|[ \\t])+`;
2995
+
2996
+ var lexer = (json) => {
2997
+ const lexer = moo.states({
2998
+ main: {
2999
+ WS: { match: new RegExp(whitespace, "u"), lineBreaks: true },
3000
+ true: { match: "true", value: () => true },
3001
+ false: { match: "false", value: () => false },
3002
+ null: { match: "null", value: () => null },
3003
+ number: { match: new RegExp(number, "u"), value: parseFloat },
3004
+ string: { match: new RegExp(string, "u"), value: JSON.parse },
3005
+ "{": "{",
3006
+ "}": "}",
3007
+ "[": "[",
3008
+ "]": "]",
3009
+ ":": ":",
3010
+ ",": ",",
3011
+ error: moo.error
3012
+ }
3013
+ });
3014
+ lexer.reset(json);
3015
+
3016
+ const _next = () => {
3017
+ let token;
3018
+ do {
3019
+ token = lexer.next();
3020
+ if (token?.type === "error") {
3021
+ throw SyntaxError(lexer.formatError(token, "Unrecognized token"));
3022
+ }
3023
+ } while (token?.type === "WS");
3024
+
3025
+ return token;
3026
+ };
3027
+
3028
+ let previous;
3029
+ let nextToken = _next();
3030
+
3031
+ const next = (expectedType = undefined) => {
3032
+ previous = nextToken;
3033
+ nextToken = _next();
3034
+ if (expectedType && previous?.type !== expectedType) {
3035
+ throw SyntaxError(lexer.formatError(previous, `Expected a '${expectedType}'`));
3036
+ }
3037
+ return previous;
3038
+ };
3039
+
3040
+ const peek = () => nextToken;
3041
+
3042
+ const defaultErrorToken = { offset: 0, line: 1, col: 0, text: "" };
3043
+ const syntaxError = (message) => {
3044
+ const referenceToken = previous || defaultErrorToken;
3045
+ const errorToken = {
3046
+ ...referenceToken,
3047
+ offset: referenceToken.offset + referenceToken.text.length,
3048
+ col: referenceToken.col + referenceToken.text.length
3049
+ };
3050
+ throw new SyntaxError(lexer.formatError(errorToken, message));
3051
+ };
3052
+
3053
+ return { next, peek, syntaxError };
3054
+ };
3055
+
3056
+ const JsonPointer$2 = lib$4;
3057
+ const jsonLexer = lexer;
3058
+
3059
+
3060
+ const defaultReviver = (key, value) => value;
3061
+ const parse$3 = (json, reviver = defaultReviver) => {
3062
+ const lexer = jsonLexer(json);
3063
+ const value = parseValue(lexer, "", JsonPointer$2.nil, reviver);
3064
+
3065
+ const token = lexer.peek();
3066
+ if (token) {
3067
+ lexer.syntaxError("A value has been parsed, but more tokens were found");
3068
+ }
3069
+ return value;
3070
+ };
3071
+
3072
+ const parseValue = (lexer, key, pointer, reviver) => {
3073
+ let value;
3074
+ const token = lexer.next();
3075
+ switch (token?.type) {
3076
+ case "true":
3077
+ case "false":
3078
+ case "null":
3079
+ case "number":
3080
+ case "string":
3081
+ value = token.value;
3082
+ break;
3083
+ case "{":
3084
+ value = parseObject(lexer, key, pointer, reviver);
3085
+ break;
3086
+ case "[":
3087
+ value = parseArray(lexer, key, pointer, reviver);
3088
+ break;
3089
+ default:
3090
+ lexer.syntaxError("Expected a JSON value");
3091
+ }
3092
+
3093
+ return reviver(key, value, pointer);
3094
+ };
3095
+
3096
+ const parseObject = (lexer, key, pointer, reviver) => {
3097
+ const value = {};
3098
+
3099
+ if (lexer.peek()?.type !== "}") {
3100
+ parseProperties(lexer, key, pointer, reviver, value);
3101
+ }
3102
+
3103
+ lexer.next("}");
3104
+
3105
+ return value;
3106
+ };
3107
+
3108
+ const parseProperties = (lexer, key, pointer, reviver, value) => {
3109
+ const propertyName = lexer.next("string").value;
3110
+ lexer.next(":");
3111
+ if (!isValueToken(lexer.peek())) {
3112
+ lexer.syntaxError("Expected a JSON value");
3113
+ }
3114
+ value[propertyName] = parseValue(lexer, propertyName, JsonPointer$2.append(propertyName, pointer), reviver);
3115
+
3116
+ if (lexer.peek()?.type === ",") {
3117
+ lexer.next(); // burn comma
3118
+ parseProperties(lexer, propertyName, pointer, reviver, value);
3119
+ } else if (isValueToken(lexer.peek())) {
3120
+ lexer.next(",");
3121
+ }
3122
+ };
3123
+
3124
+ const parseArray = (lexer, key, pointer, reviver) => {
3125
+ const value = [];
3126
+
3127
+ if (lexer.peek()?.type !== "]") {
3128
+ parseItems(lexer, 0, pointer, reviver, value);
3129
+ }
3130
+
3131
+ lexer.next("]");
3132
+
3133
+ return value;
3134
+ };
3135
+
3136
+ const parseItems = (lexer, key, pointer, reviver, value) => {
3137
+ if (!isValueToken(lexer.peek())) {
3138
+ lexer.syntaxError("Expected a JSON value");
3139
+ }
3140
+ value[key] = parseValue(lexer, key, JsonPointer$2.append(key, pointer), reviver);
3141
+ if (lexer.peek()?.type === ",") {
3142
+ lexer.next(); // burn comma
3143
+ parseItems(lexer, key + 1, pointer, reviver, value);
3144
+ } else if (isValueToken(lexer.peek())) {
3145
+ lexer.next(",");
3146
+ }
3147
+ };
3148
+
3149
+ const valueType = new Set(["string", "number", "true", "false", "null", "[", "{"]);
3150
+ const isValueToken = (token) => valueType.has(token?.type);
3151
+
3152
+ var parse_1 = parse$3;
3153
+
3154
+ const JsonPointer$1 = lib$4;
3155
+
3156
+
3157
+ const defaultReplacer = (key, value) => value;
3158
+ const stringify$2 = (value, replacer = defaultReplacer, space = "") => {
3159
+ return stringifyValue(value, replacer, space, "", JsonPointer$1.nil, 1);
3160
+ };
3161
+
3162
+ const stringifyValue = (value, replacer, space, key, pointer, depth) => {
3163
+ value = replacer(key, value, pointer);
3164
+ let result;
3165
+ if (Array.isArray(value)) {
3166
+ result = stringifyArray(value, replacer, space, pointer, depth);
3167
+ } else if (typeof value === "object" && value !== null) {
3168
+ result = stringifyObject(value, replacer, space, pointer, depth);
3169
+ } else {
3170
+ result = JSON.stringify(value);
3171
+ }
3172
+
3173
+ return result;
3174
+ };
3175
+
3176
+ const stringifyArray = (value, replacer, space, pointer, depth) => {
3177
+ if (value.length === 0) {
3178
+ space = "";
3179
+ }
3180
+ const padding = space ? `\n${space.repeat(depth - 1)}` : "";
3181
+ return "[" + padding + space + value
3182
+ .map((item, index) => {
3183
+ const indexPointer = JsonPointer$1.append(index, pointer);
3184
+ return stringifyValue(item, replacer, space, index, indexPointer, depth + 1);
3185
+ })
3186
+ .join(`,${padding}${space}`) + padding + "]";
3187
+ };
3188
+
3189
+ const stringifyObject = (value, replacer, space, pointer, depth) => {
3190
+ if (Object.keys(value).length === 0) {
3191
+ space = "";
3192
+ }
3193
+ const padding = space ? `\n${space.repeat(depth - 1)}` : "";
3194
+ const spacing = space ? " " : "";
3195
+ return "{" + padding + space + Object.entries(value)
3196
+ .map(([key, value]) => {
3197
+ const keyPointer = JsonPointer$1.append(key, pointer);
3198
+ return JSON.stringify(key) + ":" + spacing + stringifyValue(value, replacer, space, key, keyPointer, depth + 1);
3199
+ })
3200
+ .join(`,${padding}${space}`) + padding + "}";
3201
+ };
3202
+
3203
+ var stringify_1 = stringify$2;
3204
+
3205
+ const parse$2 = parse_1;
3206
+ const stringify$1 = stringify_1;
3207
+
3208
+
3209
+ var lib$3 = { parse: parse$2, stringify: stringify$1 };
3210
+
3211
+ var fetch_browser = fetch;
3212
+
3213
+ var contentType = {};
3214
+
3215
+ /*!
3216
+ * content-type
3217
+ * Copyright(c) 2015 Douglas Christopher Wilson
3218
+ * MIT Licensed
3219
+ */
3220
+
3221
+ /**
3222
+ * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
3223
+ *
3224
+ * parameter = token "=" ( token / quoted-string )
3225
+ * token = 1*tchar
3226
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
3227
+ * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
3228
+ * / DIGIT / ALPHA
3229
+ * ; any VCHAR, except delimiters
3230
+ * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
3231
+ * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
3232
+ * obs-text = %x80-FF
3233
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
3234
+ */
3235
+ var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
3236
+ var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
3237
+ var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
3238
+
3239
+ /**
3240
+ * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
3241
+ *
3242
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
3243
+ * obs-text = %x80-FF
3244
+ */
3245
+ var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
3246
+
3247
+ /**
3248
+ * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
3249
+ */
3250
+ var QUOTE_REGEXP = /([\\"])/g;
3251
+
3252
+ /**
3253
+ * RegExp to match type in RFC 7231 sec 3.1.1.1
3254
+ *
3255
+ * media-type = type "/" subtype
3256
+ * type = token
3257
+ * subtype = token
3258
+ */
3259
+ var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
3260
+
3261
+ /**
3262
+ * Module exports.
3263
+ * @public
3264
+ */
3265
+
3266
+ contentType.format = format$1;
3267
+ contentType.parse = parse$1;
3268
+
3269
+ /**
3270
+ * Format object to media type.
3271
+ *
3272
+ * @param {object} obj
3273
+ * @return {string}
3274
+ * @public
3275
+ */
3276
+
3277
+ function format$1 (obj) {
3278
+ if (!obj || typeof obj !== 'object') {
3279
+ throw new TypeError('argument obj is required')
3280
+ }
3281
+
3282
+ var parameters = obj.parameters;
3283
+ var type = obj.type;
3284
+
3285
+ if (!type || !TYPE_REGEXP.test(type)) {
3286
+ throw new TypeError('invalid type')
3287
+ }
3288
+
3289
+ var string = type;
3290
+
3291
+ // append parameters
3292
+ if (parameters && typeof parameters === 'object') {
3293
+ var param;
3294
+ var params = Object.keys(parameters).sort();
3295
+
3296
+ for (var i = 0; i < params.length; i++) {
3297
+ param = params[i];
3298
+
3299
+ if (!TOKEN_REGEXP.test(param)) {
3300
+ throw new TypeError('invalid parameter name')
3301
+ }
3302
+
3303
+ string += '; ' + param + '=' + qstring(parameters[param]);
3304
+ }
3305
+ }
3306
+
3307
+ return string
3308
+ }
3309
+
3310
+ /**
3311
+ * Parse media type to object.
3312
+ *
3313
+ * @param {string|object} string
3314
+ * @return {Object}
3315
+ * @public
3316
+ */
3317
+
3318
+ function parse$1 (string) {
3319
+ if (!string) {
3320
+ throw new TypeError('argument string is required')
3321
+ }
3322
+
3323
+ // support req/res-like objects as argument
3324
+ var header = typeof string === 'object'
3325
+ ? getcontenttype(string)
3326
+ : string;
3327
+
3328
+ if (typeof header !== 'string') {
3329
+ throw new TypeError('argument string is required to be a string')
3330
+ }
3331
+
3332
+ var index = header.indexOf(';');
3333
+ var type = index !== -1
3334
+ ? header.substr(0, index).trim()
3335
+ : header.trim();
3336
+
3337
+ if (!TYPE_REGEXP.test(type)) {
2315
3338
  throw new TypeError('invalid media type')
2316
3339
  }
2317
3340
 
@@ -2439,9 +3462,10 @@ define(['exports'], (function (exports) { 'use strict';
2439
3462
 
2440
3463
  var mediaTypes = { addPlugin, parse, getContentType };
2441
3464
 
2442
- const curry$1 = justCurryIt;
2443
- const Pact$a = lib$2;
2444
- const JsonPointer = lib$3;
3465
+ const curry$8 = justCurryIt$2;
3466
+ const Pact$a = lib$5;
3467
+ const Json = lib$3;
3468
+ const JsonPointer = lib$6;
2445
3469
  const { jsonTypeOf, resolveUrl: resolveUrl$1, urlFragment, pathRelative } = common$1;
2446
3470
  const fetch$1 = fetch_browser;
2447
3471
  const Reference$1 = reference;
@@ -2472,64 +3496,61 @@ define(['exports'], (function (exports) { 'use strict';
2472
3496
  // Schema Management
2473
3497
  const schemaStore = {};
2474
3498
  const schemaStoreAlias = {};
3499
+ const add$1 = (schema, retrievalUri = "", defaultDialectId = "") => {
3500
+ const dialectId = getDialectId(schema, retrievalUri, defaultDialectId);
2475
3501
 
2476
- const add$1 = (schema, url = "", defaultSchemaVersion = "") => {
2477
- schema = JSON.parse(JSON.stringify(schema));
2478
- const externalId = resolveUrl$1(url, "");
3502
+ const id = getBaseUri(schema, retrievalUri, dialectJsonSchemaVersion[dialectId]);
2479
3503
 
2480
- // Dialect / JSON Schema Version
2481
- const dialectId = resolveUrl$1(schema["$schema"] || defaultSchemaVersion, "");
2482
- if (!dialectId) {
2483
- throw Error("Couldn't determine schema dialect");
2484
- }
2485
- delete schema["$schema"];
3504
+ // Extract embedded schemas and collect anchors
3505
+ const embeddedToken = getConfig(dialectId, "embeddedToken");
3506
+ const baseToken = getConfig(dialectId, "baseToken");
3507
+ const anchorToken = getConfig(dialectId, "anchorToken");
3508
+ const dynamicAnchorToken = getConfig(dialectId, "dynamicAnchorToken");
3509
+ const jrefToken = getConfig(dialectId, "jrefToken");
2486
3510
 
2487
- // Determine JSON Schema version
2488
- if (!(dialectId in dialectJsonSchemaVersion)) {
2489
- if (schema?.$vocabulary?.[core201909Id] === true && dialectId === getSchemaIdentifier(schema, externalId, core201909Id)[0]) {
2490
- // Self describing 2019-09 meta-schema
2491
- dialectJsonSchemaVersion[dialectId] = core201909Id;
2492
- } else if (schema?.$vocabulary?.[core202012Id] === true && dialectId === getSchemaIdentifier(schema, externalId, core202012Id)[0]) {
2493
- // Self describing 2020-12 meta-schema
2494
- dialectJsonSchemaVersion[dialectId] = core202012Id;
2495
- } else {
2496
- // Need to look at meta-schema to determine version
2497
- const metaSchema = schemaStore[dialectId];
2498
- if (!metaSchema) {
2499
- throw Error(`Couldn't determine JSON Schema version for dialect: '${dialectId}'`);
2500
- } else if (metaSchema.vocabulary[core201909Id] === true) {
2501
- dialectJsonSchemaVersion[dialectId] = core201909Id;
2502
- } else if (metaSchema.vocabulary[core202012Id] === true) {
2503
- dialectJsonSchemaVersion[dialectId] = core202012Id;
2504
- } else {
2505
- // Assume the jsonSchemaVersion is the meta-schema's dialectId (non-standard behavior)
2506
- dialectJsonSchemaVersion[dialectId] = dialectJsonSchemaVersion[metaSchema.dialectId];
3511
+ const dynamicAnchors = {};
3512
+ const anchors = { "": "" };
3513
+
3514
+ schema = Json.parse(JSON.stringify(schema), (key, value, pointer) => {
3515
+ if (jsonTypeOf(value, "object")) {
3516
+ // Embedded Schema
3517
+ const embeddedSchemaDialectId = typeof value.$schema === "string" ? resolveUrl$1(value.$schema, "") : dialectId;
3518
+ const embeddedEmbeddedToken = getConfig(embeddedSchemaDialectId, "embeddedToken");
3519
+ const embeddedAnchorToken = getConfig(embeddedSchemaDialectId, "anchorToken");
3520
+ if (typeof value[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || value[embeddedEmbeddedToken][0] !== "#") && pointer !== "") {
3521
+ const embeddedRetrievalUri = resolveUrl$1(id, value[embeddedEmbeddedToken]);
3522
+ add$1(value, embeddedRetrievalUri, dialectId);
3523
+ return Reference$1.cons(value[embeddedEmbeddedToken], value);
3524
+ }
3525
+
3526
+ if (typeof value[jrefToken] === "string") {
3527
+ return Reference$1.cons(value[jrefToken], value);
3528
+ }
3529
+
3530
+ if (typeof value[anchorToken] === "string" && pointer !== JsonPointer.nil) {
3531
+ const anchor = anchorToken !== embeddedToken ? value[anchorToken] : value[anchorToken].slice(1);
3532
+ anchors[anchor] = pointer;
3533
+ delete value[anchorToken];
3534
+ }
3535
+
3536
+ if (typeof value[dynamicAnchorToken] === "string") {
3537
+ dynamicAnchors[value[dynamicAnchorToken]] = `${id}#${pointer}`;
3538
+ anchors[value[dynamicAnchorToken]] = pointer;
3539
+ delete value[dynamicAnchorToken];
2507
3540
  }
2508
3541
  }
2509
- }
2510
3542
 
2511
- // Internal Identifier
2512
- const [id, fragment] = getSchemaIdentifier(schema, externalId, dialectJsonSchemaVersion[dialectId]);
2513
- if (!id) {
2514
- throw Error("Couldn't determine an identifier for the schema");
2515
- }
2516
- const baseToken = getConfig(dialectId, "baseToken");
2517
- delete schema[baseToken];
2518
- if (externalId) {
2519
- schemaStoreAlias[externalId] = id;
2520
- }
3543
+ return value;
3544
+ });
3545
+ console.log(embeddedIds);
2521
3546
 
2522
- const anchorToken = getConfig(dialectId, "anchorToken");
2523
- if (fragment && baseToken === anchorToken) {
2524
- schema[anchorToken] = anchorToken !== baseToken ? encodeURI(fragment) : `#${encodeURI(fragment)}`;
2525
- }
3547
+ delete schema.$schema;
3548
+ delete schema[baseToken];
2526
3549
 
2527
3550
  // recursiveAnchor
2528
- const dynamicAnchors = {};
2529
3551
  const recursiveAnchorToken = getConfig(dialectId, "recursiveAnchorToken");
2530
3552
  if (schema[recursiveAnchorToken] === true) {
2531
3553
  dynamicAnchors[""] = `${id}#`;
2532
- schema[anchorToken] = "";
2533
3554
  delete schema[recursiveAnchorToken];
2534
3555
  }
2535
3556
 
@@ -2544,69 +3565,66 @@ define(['exports'], (function (exports) { 'use strict';
2544
3565
  }
2545
3566
 
2546
3567
  // Store Schema
2547
- const anchors = { "": "" };
2548
3568
  schemaStore[id] = {
2549
- id: id,
2550
- dialectId: dialectId,
2551
- schema: processSchema(schema, id, dialectId, JsonPointer.nil, anchors, dynamicAnchors),
2552
- anchors: anchors,
2553
- dynamicAnchors: dynamicAnchors,
2554
- vocabulary: vocabulary,
3569
+ id,
3570
+ dialectId,
3571
+ schema,
3572
+ anchors,
3573
+ dynamicAnchors,
3574
+ vocabulary,
2555
3575
  validated: false
2556
3576
  };
3577
+ if (id === "https://example.com/schema/root") {
3578
+ console.log(Object.keys(schemaStore).filter((id) => !/json-schema\.org/.test(id)));
3579
+ }
2557
3580
 
2558
- return id;
3581
+ if (retrievalUri) {
3582
+ schemaStoreAlias[resolveUrl$1(retrievalUri, "")] = id;
3583
+ }
2559
3584
  };
2560
3585
 
2561
- const getSchemaIdentifier = (schema, externalId, jsonSchemaVersion) => {
2562
- const baseToken = config[jsonSchemaVersion]?.["baseToken"];
2563
- const internalUrl = resolveUrl$1(externalId, schema[baseToken] || "");
2564
- return [resolveUrl$1(internalUrl, ""), urlFragment(internalUrl)];
2565
- };
2566
-
2567
- const processSchema = (subject, id, dialectId, pointer, anchors, dynamicAnchors) => {
2568
- if (jsonTypeOf(subject, "object")) {
2569
- const embeddedSchemaDialectId = typeof subject.$schema === "string" ? resolveUrl$1(subject.$schema, "") : dialectId;
2570
- const embeddedEmbeddedToken = getConfig(embeddedSchemaDialectId, "embeddedToken");
2571
- const embeddedAnchorToken = getConfig(embeddedSchemaDialectId, "anchorToken");
2572
- if (typeof subject[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || subject[embeddedEmbeddedToken][0] !== "#")) {
2573
- const ref = resolveUrl$1(id, subject[embeddedEmbeddedToken]);
2574
- const embeddedBaseToken = getConfig(embeddedSchemaDialectId, "baseToken");
2575
- subject[embeddedBaseToken] = ref;
2576
- add$1(subject, ref, dialectId);
2577
- return Reference$1.cons(subject[embeddedEmbeddedToken], subject);
2578
- }
2579
-
2580
- const anchorToken = getConfig(dialectId, "anchorToken");
2581
- const dynamicAnchorToken = getConfig(dialectId, "dynamicAnchorToken");
2582
- if (typeof subject[dynamicAnchorToken] === "string") {
2583
- dynamicAnchors[subject[dynamicAnchorToken]] = `${id}#${encodeURI(pointer)}`;
2584
- anchors[subject[dynamicAnchorToken]] = pointer;
2585
- delete subject[dynamicAnchorToken];
2586
- }
2587
-
2588
- const embeddedToken = getConfig(dialectId, "embeddedToken");
2589
- if (typeof subject[anchorToken] === "string") {
2590
- const anchor = anchorToken !== embeddedToken ? subject[anchorToken] : subject[anchorToken].slice(1);
2591
- anchors[anchor] = pointer;
2592
- delete subject[anchorToken];
2593
- }
3586
+ const getDialectId = (schema, retrievalUri, defaultDialectId) => {
3587
+ const dialectId = resolveUrl$1(schema.$schema || defaultDialectId, "");
3588
+ if (!dialectId) {
3589
+ throw Error("Couldn't determine schema dialect");
3590
+ }
2594
3591
 
2595
- const jrefToken = getConfig(dialectId, "jrefToken");
2596
- if (typeof subject[jrefToken] === "string") {
2597
- return Reference$1.cons(subject[jrefToken], subject);
3592
+ // Determine JSON Schema version
3593
+ if (!(dialectId in dialectJsonSchemaVersion)) {
3594
+ if (schema?.$vocabulary?.[core201909Id] === true && dialectId === getBaseUri(schema, retrievalUri, core201909Id)) {
3595
+ // Self describing 2019-09 meta-schema
3596
+ dialectJsonSchemaVersion[dialectId] = core201909Id;
3597
+ } else if (schema?.$vocabulary?.[core202012Id] === true && dialectId === getBaseUri(schema, retrievalUri, core202012Id)) {
3598
+ // Self describing 2020-12 meta-schema
3599
+ dialectJsonSchemaVersion[dialectId] = core202012Id;
3600
+ } else {
3601
+ // Need to look at meta-schema to determine version
3602
+ const metaSchema = schemaStore[dialectId];
3603
+ if (!metaSchema) {
3604
+ throw Error(`Couldn't determine JSON Schema version for dialect: '${dialectId}'`);
3605
+ } else if (metaSchema.vocabulary[core201909Id] === true) {
3606
+ dialectJsonSchemaVersion[dialectId] = core201909Id;
3607
+ } else if (metaSchema.vocabulary[core202012Id] === true) {
3608
+ dialectJsonSchemaVersion[dialectId] = core202012Id;
3609
+ } else {
3610
+ // Assume the jsonSchemaVersion is the meta-schema's dialectId (non-standard behavior)
3611
+ dialectJsonSchemaVersion[dialectId] = dialectJsonSchemaVersion[metaSchema.dialectId];
3612
+ }
2598
3613
  }
3614
+ }
2599
3615
 
2600
- for (const key in subject) {
2601
- subject[key] = processSchema(subject[key], id, dialectId, JsonPointer.append(key, pointer), anchors, dynamicAnchors);
2602
- }
3616
+ return dialectId;
3617
+ };
2603
3618
 
2604
- return subject;
2605
- } else if (Array.isArray(subject)) {
2606
- return subject.map((item, ndx) => processSchema(item, id, dialectId, JsonPointer.append(ndx, pointer), anchors, dynamicAnchors));
2607
- } else {
2608
- return subject;
3619
+ const getBaseUri = (schema, retrievalUri, jsonSchemaVersion) => {
3620
+ const baseToken = config[jsonSchemaVersion]?.["baseToken"];
3621
+ const relativeBaseUri = typeof schema[baseToken] === "string" ? schema[baseToken] : "";
3622
+ const baseUri = resolveUrl$1(resolveUrl$1(retrievalUri, relativeBaseUri), "");
3623
+ if (!baseUri) {
3624
+ throw Error("Couldn't determine an identifier for the schema");
2609
3625
  }
3626
+
3627
+ return baseUri;
2610
3628
  };
2611
3629
 
2612
3630
  const hasStoredSchema = (id) => id in schemaStore || id in schemaStoreAlias;
@@ -2643,13 +3661,21 @@ define(['exports'], (function (exports) { 'use strict';
2643
3661
 
2644
3662
  const [schema, defaultDialectId] = await MediaTypes$1.parse(response);
2645
3663
 
3664
+ let dialectId;
3665
+ if (schema.$schema) {
3666
+ dialectId = resolveUrl$1(schema.$schema, "");
3667
+ } else if (defaultDialectId) {
3668
+ dialectId = resolveUrl$1(id, defaultDialectId);
3669
+ } else {
3670
+ dialectId = "";
3671
+ }
3672
+
2646
3673
  // Make sure the meta-schema is loaded if this isn't a known dialect
2647
- const dialectId = resolveUrl$1(schema.$schema, "") || defaultDialectId;
2648
- if (id !== dialectId && !(dialectId in dialectJsonSchemaVersion)) {
3674
+ if (dialectId && id !== dialectId && !(dialectId in dialectJsonSchemaVersion)) {
2649
3675
  await get(dialectId);
2650
3676
  }
2651
3677
 
2652
- add$1(schema, id);
3678
+ add$1(schema, id, dialectId);
2653
3679
  }
2654
3680
 
2655
3681
  const storedSchema = getStoredSchema(id);
@@ -2692,14 +3718,14 @@ define(['exports'], (function (exports) { 'use strict';
2692
3718
 
2693
3719
  const keys = (doc) => Object.keys(value(doc));
2694
3720
 
2695
- const entries = (doc) => Pact$a.pipeline([
3721
+ const entries$2 = (doc) => Pact$a.pipeline([
2696
3722
  value,
2697
3723
  Object.keys,
2698
3724
  Pact$a.map(async (key) => [key, await step(key, doc)]),
2699
3725
  Pact$a.all
2700
3726
  ], doc);
2701
3727
 
2702
- const map = curry$1((fn, doc) => Pact$a.pipeline([
3728
+ const map$3 = curry$8((fn, doc) => Pact$a.pipeline([
2703
3729
  value,
2704
3730
  Pact$a.map(async (item, ndx) => fn(await step(ndx, doc), ndx)),
2705
3731
  Pact$a.all
@@ -2715,41 +3741,43 @@ define(['exports'], (function (exports) { 'use strict';
2715
3741
  const toSchema = (schemaDoc, options = {}) => {
2716
3742
  const fullOptions = { ...toSchemaDefaultOptions, ...options };
2717
3743
 
2718
- const schema = JSON.parse(JSON.stringify(schemaDoc.schema, (key, value) => {
2719
- if (!Reference$1.isReference(value)) {
2720
- return value;
3744
+ const anchorToken = getConfig(schemaDoc.dialectId, "anchorToken");
3745
+ const dynamicAnchorToken = getConfig(schemaDoc.dialectId, "dynamicAnchorToken");
3746
+
3747
+ const anchors = {};
3748
+ for (const anchor in schemaDoc.anchors) {
3749
+ if (anchor !== "" && !schemaDoc.dynamicAnchors[anchor]) {
3750
+ anchors[schemaDoc.anchors[anchor]] = anchor;
2721
3751
  }
3752
+ }
3753
+
3754
+ const dynamicAnchors = {};
3755
+ for (const anchor in schemaDoc.dynamicAnchors) {
3756
+ const pointer = urlFragment(schemaDoc.dynamicAnchors[anchor]);
3757
+ dynamicAnchors[pointer] = anchor;
3758
+ }
2722
3759
 
2723
- const refValue = Reference$1.value(value);
2724
- const embeddedDialect = typeof refValue.$schema === "string" ? resolveUrl$1(refValue.$schema, "") : schemaDoc.dialectId;
2725
- const embeddedToken = getConfig(embeddedDialect, "embeddedToken");
2726
- if (!fullOptions.includeEmbedded && embeddedToken in refValue) {
2727
- return;
3760
+ const schema = JSON.parse(Json.stringify(schemaDoc.schema, (key, value, pointer) => {
3761
+ if (Reference$1.isReference(value)) {
3762
+ const refValue = Reference$1.value(value);
3763
+ const embeddedDialect = typeof refValue.$schema === "string" ? resolveUrl$1(refValue.$schema, "") : schemaDoc.dialectId;
3764
+ const embeddedToken = getConfig(embeddedDialect, "embeddedToken");
3765
+ if (!fullOptions.includeEmbedded && embeddedToken in refValue) {
3766
+ return;
3767
+ } else {
3768
+ return Reference$1.value(value);
3769
+ }
2728
3770
  } else {
2729
- return Reference$1.value(value);
3771
+ if (pointer in anchors) {
3772
+ value = { [anchorToken]: anchors[pointer], ...value };
3773
+ }
3774
+ if (pointer in dynamicAnchors) {
3775
+ value = { [dynamicAnchorToken]: dynamicAnchors[pointer], ...value };
3776
+ }
3777
+ return value;
2730
3778
  }
2731
3779
  }));
2732
3780
 
2733
- const dynamicAnchorToken = getConfig(schemaDoc.dialectId, "dynamicAnchorToken");
2734
- Object.entries(schemaDoc.dynamicAnchors)
2735
- .forEach(([anchor, uri]) => {
2736
- const pointer = urlFragment(uri);
2737
- JsonPointer.assign(pointer, schema, {
2738
- [dynamicAnchorToken]: anchor,
2739
- ...JsonPointer.get(pointer, schema)
2740
- });
2741
- });
2742
-
2743
- const anchorToken = getConfig(schemaDoc.dialectId, "anchorToken");
2744
- Object.entries(schemaDoc.anchors)
2745
- .filter(([anchor]) => anchor !== "")
2746
- .forEach(([anchor, pointer]) => {
2747
- JsonPointer.assign(pointer, schema, {
2748
- [anchorToken]: anchor,
2749
- ...JsonPointer.get(pointer, schema)
2750
- });
2751
- });
2752
-
2753
3781
  const baseToken = getConfig(schemaDoc.dialectId, "baseToken");
2754
3782
  const id = relativeUri(fullOptions.parentId, schemaDoc.id);
2755
3783
  const dialect = fullOptions.parentDialect === schemaDoc.dialectId ? "" : schemaDoc.dialectId;
@@ -2772,7 +3800,7 @@ define(['exports'], (function (exports) { 'use strict';
2772
3800
  var schema$5 = {
2773
3801
  setConfig, getConfig,
2774
3802
  add: add$1, get, markValidated,
2775
- uri, value, getAnchorPointer, typeOf, has, step, keys, entries, map, length,
3803
+ uri, value, getAnchorPointer, typeOf, has, step, keys, entries: entries$2, map: map$3, length,
2776
3804
  toSchema
2777
3805
  };
2778
3806
 
@@ -2794,7 +3822,7 @@ define(['exports'], (function (exports) { 'use strict';
2794
3822
 
2795
3823
  var metaData$4 = { compile: compile$O, interpret: interpret$O };
2796
3824
 
2797
- const curry = justCurryIt;
3825
+ const curry$7 = justCurryIt$2;
2798
3826
  const PubSub$1 = pubsub.exports;
2799
3827
  const { resolveUrl } = common$1;
2800
3828
  const Instance$E = instance;
@@ -2830,7 +3858,7 @@ define(['exports'], (function (exports) { 'use strict';
2830
3858
  return { ast, schemaUri };
2831
3859
  };
2832
3860
 
2833
- const interpret$N = curry(({ ast, schemaUri }, value, outputFormat = FLAG) => {
3861
+ const interpret$N = curry$7(({ ast, schemaUri }, value, outputFormat = FLAG) => {
2834
3862
  if (![FLAG, BASIC, DETAILED, VERBOSE].includes(outputFormat)) {
2835
3863
  throw Error(`The '${outputFormat}' error format is not supported`);
2836
3864
  }
@@ -3000,7 +4028,7 @@ define(['exports'], (function (exports) { 'use strict';
3000
4028
  addMediaTypePlugin: MediaTypes.addPlugin
3001
4029
  };
3002
4030
 
3003
- const Pact$9 = lib$2;
4031
+ const Pact$9 = lib$5;
3004
4032
  const PubSub = pubsub.exports;
3005
4033
  const Core$x = core$2;
3006
4034
  const Instance$D = instance;
@@ -3113,9 +4141,9 @@ define(['exports'], (function (exports) { 'use strict';
3113
4141
  const InvalidSchemaError$1 = invalidSchemaError;
3114
4142
 
3115
4143
 
3116
- var lib$1 = { Core: Core$w, Schema: Schema$O, Instance: Instance$C, Reference, Keywords: Keywords$2, InvalidSchemaError: InvalidSchemaError$1 };
4144
+ var lib$2 = { Core: Core$w, Schema: Schema$O, Instance: Instance$C, Reference, Keywords: Keywords$2, InvalidSchemaError: InvalidSchemaError$1 };
3117
4145
 
3118
- const { Core: Core$v, Schema: Schema$N, Instance: Instance$B } = lib$1;
4146
+ const { Core: Core$v, Schema: Schema$N, Instance: Instance$B } = lib$2;
3119
4147
 
3120
4148
 
3121
4149
  const compile$L = async (schema, ast, parentSchema) => {
@@ -3143,7 +4171,7 @@ define(['exports'], (function (exports) { 'use strict';
3143
4171
 
3144
4172
  var additionalItems = { compile: compile$L, interpret: interpret$L };
3145
4173
 
3146
- const { Core: Core$u, Schema: Schema$M, Instance: Instance$A } = lib$1;
4174
+ const { Core: Core$u, Schema: Schema$M, Instance: Instance$A } = lib$2;
3147
4175
 
3148
4176
 
3149
4177
  const compile$K = async (schema, ast, parentSchema) => {
@@ -3167,7 +4195,7 @@ define(['exports'], (function (exports) { 'use strict';
3167
4195
 
3168
4196
  var additionalItems6 = { compile: compile$K, interpret: interpret$K, collectEvaluatedItems: collectEvaluatedItems$d };
3169
4197
 
3170
- const { Core: Core$t, Schema: Schema$L, Instance: Instance$z } = lib$1;
4198
+ const { Core: Core$t, Schema: Schema$L, Instance: Instance$z } = lib$2;
3171
4199
 
3172
4200
 
3173
4201
  const compile$J = async (schema, ast, parentSchema) => {
@@ -3201,7 +4229,7 @@ define(['exports'], (function (exports) { 'use strict';
3201
4229
 
3202
4230
  var additionalProperties = { compile: compile$J, interpret: interpret$J };
3203
4231
 
3204
- const { Core: Core$s, Schema: Schema$K, Instance: Instance$y } = lib$1;
4232
+ const { Core: Core$s, Schema: Schema$K, Instance: Instance$y } = lib$2;
3205
4233
 
3206
4234
 
3207
4235
  const compile$I = async (schema, ast, parentSchema) => {
@@ -3230,8 +4258,129 @@ define(['exports'], (function (exports) { 'use strict';
3230
4258
 
3231
4259
  var additionalProperties6 = { compile: compile$I, interpret: interpret$I, collectEvaluatedProperties: collectEvaluatedProperties$c };
3232
4260
 
3233
- const { Core: Core$r, Schema: Schema$J } = lib$1;
3234
- const Pact$8 = lib$2;
4261
+ var entries$1 = async (doc) => Object.entries(await doc);
4262
+
4263
+ var justCurryIt = curry$6;
4264
+
4265
+ /*
4266
+ function add(a, b, c) {
4267
+ return a + b + c;
4268
+ }
4269
+ curry(add)(1)(2)(3); // 6
4270
+ curry(add)(1)(2)(2); // 5
4271
+ curry(add)(2)(4, 3); // 9
4272
+
4273
+ function add(...args) {
4274
+ return args.reduce((sum, n) => sum + n, 0)
4275
+ }
4276
+ var curryAdd4 = curry(add, 4)
4277
+ curryAdd4(1)(2, 3)(4); // 10
4278
+
4279
+ function converter(ratio, input) {
4280
+ return (input*ratio).toFixed(1);
4281
+ }
4282
+ const curriedConverter = curry(converter)
4283
+ const milesToKm = curriedConverter(1.62);
4284
+ milesToKm(35); // 56.7
4285
+ milesToKm(10); // 16.2
4286
+ */
4287
+
4288
+ function curry$6(fn, arity) {
4289
+ return function curried() {
4290
+ if (arity == null) {
4291
+ arity = fn.length;
4292
+ }
4293
+ var args = [].slice.call(arguments);
4294
+ if (args.length >= arity) {
4295
+ return fn.apply(this, args);
4296
+ } else {
4297
+ return function() {
4298
+ return curried.apply(this, args.concat([].slice.call(arguments)));
4299
+ };
4300
+ }
4301
+ };
4302
+ }
4303
+
4304
+ const curry$5 = justCurryIt;
4305
+
4306
+
4307
+ var map$2 = curry$5(async (fn, doc) => (await doc).map(fn));
4308
+
4309
+ const curry$4 = justCurryIt;
4310
+
4311
+
4312
+ var reduce$2 = curry$4(async (fn, acc, doc) => {
4313
+ return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
4314
+ });
4315
+
4316
+ const curry$3 = justCurryIt;
4317
+ const reduce$1 = reduce$2;
4318
+
4319
+
4320
+ var filter = curry$3(async (fn, doc, options = {}) => {
4321
+ return reduce$1(async (acc, item) => {
4322
+ return (await fn(item)) ? acc.concat([item]) : acc;
4323
+ }, [], doc, options);
4324
+ });
4325
+
4326
+ const curry$2 = justCurryIt;
4327
+ const map$1 = map$2;
4328
+
4329
+
4330
+ var some = curry$2(async (fn, doc) => {
4331
+ const results = await map$1(fn, doc);
4332
+ return (await Promise.all(results))
4333
+ .some((a) => a);
4334
+ });
4335
+
4336
+ const curry$1 = justCurryIt;
4337
+ const map = map$2;
4338
+
4339
+
4340
+ var every = curry$1(async (fn, doc) => {
4341
+ const results = await map(fn, doc);
4342
+ return (await Promise.all(results))
4343
+ .every((a) => a);
4344
+ });
4345
+
4346
+ const curry = justCurryIt;
4347
+
4348
+
4349
+ var pipeline$1 = curry((fns, doc) => {
4350
+ return fns.reduce(async (acc, fn) => fn(await acc), doc);
4351
+ });
4352
+
4353
+ var all = (doc) => Promise.all(doc);
4354
+
4355
+ const pipeline = pipeline$1;
4356
+ const entries = entries$1;
4357
+ const reduce = reduce$2;
4358
+
4359
+
4360
+ var allValues = (doc) => {
4361
+ return pipeline([
4362
+ entries,
4363
+ reduce(async (acc, [propertyName, propertyValue]) => {
4364
+ acc[propertyName] = await propertyValue;
4365
+ return acc;
4366
+ }, {})
4367
+ ], doc);
4368
+ };
4369
+
4370
+ var lib$1 = {
4371
+ entries: entries$1,
4372
+ map: map$2,
4373
+ filter: filter,
4374
+ reduce: reduce$2,
4375
+ some: some,
4376
+ every: every,
4377
+ pipeline: pipeline$1,
4378
+ all: all,
4379
+ allValues: allValues
4380
+ };
4381
+
4382
+ const { Core: Core$r, Schema: Schema$J } = lib$2;
4383
+ const Pact$8 = lib$1;
3235
4384
 
3236
4385
 
3237
4386
  const compile$H = (schema, ast) => Pact$8.pipeline([
@@ -3259,8 +4408,8 @@ define(['exports'], (function (exports) { 'use strict';
3259
4408
 
3260
4409
  var allOf = { compile: compile$H, interpret: interpret$H, collectEvaluatedProperties: collectEvaluatedProperties$b, collectEvaluatedItems: collectEvaluatedItems$c };
3261
4410
 
3262
- const { Core: Core$q, Schema: Schema$I } = lib$1;
3263
- const Pact$7 = lib$2;
4411
+ const { Core: Core$q, Schema: Schema$I } = lib$2;
4412
+ const Pact$7 = lib$1;
3264
4413
 
3265
4414
 
3266
4415
  const compile$G = (schema, ast) => Pact$7.pipeline([
@@ -3348,7 +4497,7 @@ define(['exports'], (function (exports) { 'use strict';
3348
4497
 
3349
4498
  var fastestStableStringify = function(obj) { return '' + stringify(obj, false); };
3350
4499
 
3351
- const { Schema: Schema$H, Instance: Instance$x } = lib$1;
4500
+ const { Schema: Schema$H, Instance: Instance$x } = lib$2;
3352
4501
  const jsonStringify$2 = fastestStableStringify;
3353
4502
 
3354
4503
 
@@ -3357,7 +4506,7 @@ define(['exports'], (function (exports) { 'use strict';
3357
4506
 
3358
4507
  var _const = { compile: compile$F, interpret: interpret$F };
3359
4508
 
3360
- const { Core: Core$p, Instance: Instance$w } = lib$1;
4509
+ const { Core: Core$p, Instance: Instance$w } = lib$2;
3361
4510
 
3362
4511
 
3363
4512
  const compile$E = (schema, ast) => Core$p.compileSchema(schema, ast);
@@ -3368,7 +4517,7 @@ define(['exports'], (function (exports) { 'use strict';
3368
4517
 
3369
4518
  var contains = { compile: compile$E, interpret: interpret$E };
3370
4519
 
3371
- const { Core: Core$o, Schema: Schema$G, Instance: Instance$v } = lib$1;
4520
+ const { Core: Core$o, Schema: Schema$G, Instance: Instance$v } = lib$2;
3372
4521
 
3373
4522
 
3374
4523
  const compile$D = async (schema, ast, parentSchema) => {
@@ -3402,8 +4551,8 @@ define(['exports'], (function (exports) { 'use strict';
3402
4551
 
3403
4552
  var containsMinContainsMaxContains = { compile: compile$D, interpret: interpret$D, collectEvaluatedItems: collectEvaluatedItems$a };
3404
4553
 
3405
- const { Core: Core$n, Schema: Schema$F } = lib$1;
3406
- const Pact$6 = lib$2;
4554
+ const { Core: Core$n, Schema: Schema$F } = lib$2;
4555
+ const Pact$6 = lib$1;
3407
4556
 
3408
4557
 
3409
4558
  const compile$C = async (schema, ast) => {
@@ -3418,8 +4567,8 @@ define(['exports'], (function (exports) { 'use strict';
3418
4567
 
3419
4568
  var definitions = { compile: compile$C, interpret: interpret$C };
3420
4569
 
3421
- const { Core: Core$m, Schema: Schema$E, Instance: Instance$u } = lib$1;
3422
- const Pact$5 = lib$2;
4570
+ const { Core: Core$m, Schema: Schema$E, Instance: Instance$u } = lib$2;
4571
+ const Pact$5 = lib$1;
3423
4572
 
3424
4573
 
3425
4574
  const compile$B = (schema, ast) => Pact$5.pipeline([
@@ -3448,8 +4597,8 @@ define(['exports'], (function (exports) { 'use strict';
3448
4597
 
3449
4598
  var dependencies = { compile: compile$B, interpret: interpret$B };
3450
4599
 
3451
- const { Schema: Schema$D, Instance: Instance$t } = lib$1;
3452
- const Pact$4 = lib$2;
4600
+ const { Schema: Schema$D, Instance: Instance$t } = lib$2;
4601
+ const Pact$4 = lib$1;
3453
4602
 
3454
4603
 
3455
4604
  const compile$A = (schema) => Pact$4.pipeline([
@@ -3468,8 +4617,8 @@ define(['exports'], (function (exports) { 'use strict';
3468
4617
 
3469
4618
  var dependentRequired = { compile: compile$A, interpret: interpret$A };
3470
4619
 
3471
- const { Core: Core$l, Schema: Schema$C, Instance: Instance$s } = lib$1;
3472
- const Pact$3 = lib$2;
4620
+ const { Core: Core$l, Schema: Schema$C, Instance: Instance$s } = lib$2;
4621
+ const Pact$3 = lib$1;
3473
4622
 
3474
4623
 
3475
4624
  const compile$z = (schema, ast) => Pact$3.pipeline([
@@ -3499,7 +4648,7 @@ define(['exports'], (function (exports) { 'use strict';
3499
4648
 
3500
4649
  var dependentSchemas = { compile: compile$z, interpret: interpret$z, collectEvaluatedProperties: collectEvaluatedProperties$9 };
3501
4650
 
3502
- const { Schema: Schema$B, Instance: Instance$r } = lib$1;
4651
+ const { Schema: Schema$B, Instance: Instance$r } = lib$2;
3503
4652
  const jsonStringify$1 = fastestStableStringify;
3504
4653
 
3505
4654
 
@@ -3508,7 +4657,7 @@ define(['exports'], (function (exports) { 'use strict';
3508
4657
 
3509
4658
  var _enum = { compile: compile$y, interpret: interpret$y };
3510
4659
 
3511
- const { Schema: Schema$A, Instance: Instance$q } = lib$1;
4660
+ const { Schema: Schema$A, Instance: Instance$q } = lib$2;
3512
4661
 
3513
4662
 
3514
4663
  const compile$x = async (schema) => Schema$A.value(schema);
@@ -3516,7 +4665,7 @@ define(['exports'], (function (exports) { 'use strict';
3516
4665
 
3517
4666
  var exclusiveMaximum = { compile: compile$x, interpret: interpret$x };
3518
4667
 
3519
- const { Schema: Schema$z, Instance: Instance$p } = lib$1;
4668
+ const { Schema: Schema$z, Instance: Instance$p } = lib$2;
3520
4669
 
3521
4670
 
3522
4671
  const compile$w = async (schema) => Schema$z.value(schema);
@@ -3524,7 +4673,7 @@ define(['exports'], (function (exports) { 'use strict';
3524
4673
 
3525
4674
  var exclusiveMinimum = { compile: compile$w, interpret: interpret$w };
3526
4675
 
3527
- const { Core: Core$k } = lib$1;
4676
+ const { Core: Core$k } = lib$2;
3528
4677
 
3529
4678
 
3530
4679
  const compile$v = (schema, ast) => Core$k.compileSchema(schema, ast);
@@ -3544,7 +4693,7 @@ define(['exports'], (function (exports) { 'use strict';
3544
4693
 
3545
4694
  var _if = { compile: compile$v, interpret: interpret$v, collectEvaluatedProperties: collectEvaluatedProperties$8, collectEvaluatedItems: collectEvaluatedItems$9 };
3546
4695
 
3547
- const { Core: Core$j, Schema: Schema$y } = lib$1;
4696
+ const { Core: Core$j, Schema: Schema$y } = lib$2;
3548
4697
 
3549
4698
 
3550
4699
  const compile$u = async (schema, ast, parentSchema) => {
@@ -3588,7 +4737,7 @@ define(['exports'], (function (exports) { 'use strict';
3588
4737
 
3589
4738
  var then = { compile: compile$u, interpret: interpret$u, collectEvaluatedProperties: collectEvaluatedProperties$7, collectEvaluatedItems: collectEvaluatedItems$8 };
3590
4739
 
3591
- const { Core: Core$i, Schema: Schema$x } = lib$1;
4740
+ const { Core: Core$i, Schema: Schema$x } = lib$2;
3592
4741
 
3593
4742
 
3594
4743
  const compile$t = async (schema, ast, parentSchema) => {
@@ -3632,7 +4781,7 @@ define(['exports'], (function (exports) { 'use strict';
3632
4781
 
3633
4782
  var _else = { compile: compile$t, interpret: interpret$t, collectEvaluatedProperties: collectEvaluatedProperties$6, collectEvaluatedItems: collectEvaluatedItems$7 };
3634
4783
 
3635
- const { Core: Core$h, Schema: Schema$w, Instance: Instance$o } = lib$1;
4784
+ const { Core: Core$h, Schema: Schema$w, Instance: Instance$o } = lib$2;
3636
4785
 
3637
4786
 
3638
4787
  const compile$s = async (schema, ast) => {
@@ -3664,7 +4813,7 @@ define(['exports'], (function (exports) { 'use strict';
3664
4813
 
3665
4814
  var items = { compile: compile$s, interpret: interpret$s, collectEvaluatedItems: collectEvaluatedItems$6 };
3666
4815
 
3667
- const { Core: Core$g, Schema: Schema$v, Instance: Instance$n } = lib$1;
4816
+ const { Core: Core$g, Schema: Schema$v, Instance: Instance$n } = lib$2;
3668
4817
 
3669
4818
 
3670
4819
  const compile$r = async (schema, ast, parentSchema) => {
@@ -3688,7 +4837,7 @@ define(['exports'], (function (exports) { 'use strict';
3688
4837
 
3689
4838
  var items202012 = { compile: compile$r, interpret: interpret$r, collectEvaluatedItems: collectEvaluatedItems$5 };
3690
4839
 
3691
- const { Schema: Schema$u, Instance: Instance$m } = lib$1;
4840
+ const { Schema: Schema$u, Instance: Instance$m } = lib$2;
3692
4841
 
3693
4842
 
3694
4843
  const compile$q = (schema) => Schema$u.value(schema);
@@ -3696,7 +4845,7 @@ define(['exports'], (function (exports) { 'use strict';
3696
4845
 
3697
4846
  var maxItems = { compile: compile$q, interpret: interpret$q };
3698
4847
 
3699
- const { Schema: Schema$t, Instance: Instance$l } = lib$1;
4848
+ const { Schema: Schema$t, Instance: Instance$l } = lib$2;
3700
4849
 
3701
4850
 
3702
4851
  const compile$p = (schema) => Schema$t.value(schema);
@@ -3704,7 +4853,7 @@ define(['exports'], (function (exports) { 'use strict';
3704
4853
 
3705
4854
  var maxLength = { compile: compile$p, interpret: interpret$p };
3706
4855
 
3707
- const { Schema: Schema$s, Instance: Instance$k } = lib$1;
4856
+ const { Schema: Schema$s, Instance: Instance$k } = lib$2;
3708
4857
 
3709
4858
 
3710
4859
  const compile$o = (schema) => Schema$s.value(schema);
@@ -3712,7 +4861,7 @@ define(['exports'], (function (exports) { 'use strict';
3712
4861
 
3713
4862
  var maxLength6 = { compile: compile$o, interpret: interpret$o };
3714
4863
 
3715
- const { Schema: Schema$r, Instance: Instance$j } = lib$1;
4864
+ const { Schema: Schema$r, Instance: Instance$j } = lib$2;
3716
4865
 
3717
4866
 
3718
4867
  const compile$n = (schema) => Schema$r.value(schema);
@@ -3720,7 +4869,7 @@ define(['exports'], (function (exports) { 'use strict';
3720
4869
 
3721
4870
  var maxProperties = { compile: compile$n, interpret: interpret$n };
3722
4871
 
3723
- const { Schema: Schema$q, Instance: Instance$i } = lib$1;
4872
+ const { Schema: Schema$q, Instance: Instance$i } = lib$2;
3724
4873
 
3725
4874
 
3726
4875
  const compile$m = async (schema, ast, parentSchema) => {
@@ -3741,7 +4890,7 @@ define(['exports'], (function (exports) { 'use strict';
3741
4890
 
3742
4891
  var maximumExclusiveMaximum = { compile: compile$m, interpret: interpret$m };
3743
4892
 
3744
- const { Schema: Schema$p, Instance: Instance$h } = lib$1;
4893
+ const { Schema: Schema$p, Instance: Instance$h } = lib$2;
3745
4894
 
3746
4895
 
3747
4896
  const compile$l = async (schema) => Schema$p.value(schema);
@@ -3749,7 +4898,7 @@ define(['exports'], (function (exports) { 'use strict';
3749
4898
 
3750
4899
  var maximum = { compile: compile$l, interpret: interpret$l };
3751
4900
 
3752
- const { Schema: Schema$o, Instance: Instance$g } = lib$1;
4901
+ const { Schema: Schema$o, Instance: Instance$g } = lib$2;
3753
4902
 
3754
4903
 
3755
4904
  const compile$k = (schema) => Schema$o.value(schema);
@@ -3757,7 +4906,7 @@ define(['exports'], (function (exports) { 'use strict';
3757
4906
 
3758
4907
  var minItems = { compile: compile$k, interpret: interpret$k };
3759
4908
 
3760
- const { Schema: Schema$n, Instance: Instance$f } = lib$1;
4909
+ const { Schema: Schema$n, Instance: Instance$f } = lib$2;
3761
4910
 
3762
4911
 
3763
4912
  const compile$j = (schema) => Schema$n.value(schema);
@@ -3765,7 +4914,7 @@ define(['exports'], (function (exports) { 'use strict';
3765
4914
 
3766
4915
  var minLength = { compile: compile$j, interpret: interpret$j };
3767
4916
 
3768
- const { Schema: Schema$m, Instance: Instance$e } = lib$1;
4917
+ const { Schema: Schema$m, Instance: Instance$e } = lib$2;
3769
4918
 
3770
4919
 
3771
4920
  const compile$i = (schema) => Schema$m.value(schema);
@@ -3773,7 +4922,7 @@ define(['exports'], (function (exports) { 'use strict';
3773
4922
 
3774
4923
  var minLength6 = { compile: compile$i, interpret: interpret$i };
3775
4924
 
3776
- const { Schema: Schema$l, Instance: Instance$d } = lib$1;
4925
+ const { Schema: Schema$l, Instance: Instance$d } = lib$2;
3777
4926
 
3778
4927
 
3779
4928
  const compile$h = (schema) => Schema$l.value(schema);
@@ -3781,7 +4930,7 @@ define(['exports'], (function (exports) { 'use strict';
3781
4930
 
3782
4931
  var minProperties = { compile: compile$h, interpret: interpret$h };
3783
4932
 
3784
- const { Schema: Schema$k, Instance: Instance$c } = lib$1;
4933
+ const { Schema: Schema$k, Instance: Instance$c } = lib$2;
3785
4934
 
3786
4935
 
3787
4936
  const compile$g = async (schema, ast, parentSchema) => {
@@ -3802,7 +4951,7 @@ define(['exports'], (function (exports) { 'use strict';
3802
4951
 
3803
4952
  var minimumExclusiveMinimum = { compile: compile$g, interpret: interpret$g };
3804
4953
 
3805
- const { Schema: Schema$j, Instance: Instance$b } = lib$1;
4954
+ const { Schema: Schema$j, Instance: Instance$b } = lib$2;
3806
4955
 
3807
4956
 
3808
4957
  const compile$f = async (schema) => Schema$j.value(schema);
@@ -3810,7 +4959,7 @@ define(['exports'], (function (exports) { 'use strict';
3810
4959
 
3811
4960
  var minimum = { compile: compile$f, interpret: interpret$f };
3812
4961
 
3813
- const { Schema: Schema$i, Instance: Instance$a } = lib$1;
4962
+ const { Schema: Schema$i, Instance: Instance$a } = lib$2;
3814
4963
 
3815
4964
 
3816
4965
  const compile$e = (schema) => Schema$i.value(schema);
@@ -3828,7 +4977,7 @@ define(['exports'], (function (exports) { 'use strict';
3828
4977
 
3829
4978
  var multipleOf = { compile: compile$e, interpret: interpret$e };
3830
4979
 
3831
- const { Core: Core$f } = lib$1;
4980
+ const { Core: Core$f } = lib$2;
3832
4981
 
3833
4982
 
3834
4983
  const compile$d = Core$f.compileSchema;
@@ -3836,7 +4985,7 @@ define(['exports'], (function (exports) { 'use strict';
3836
4985
 
3837
4986
  var not = { compile: compile$d, interpret: interpret$d };
3838
4987
 
3839
- const { Core: Core$e, Schema: Schema$h } = lib$1;
4988
+ const { Core: Core$e, Schema: Schema$h } = lib$2;
3840
4989
 
3841
4990
 
3842
4991
  const compile$c = async (schema, ast) => {
@@ -3885,7 +5034,7 @@ define(['exports'], (function (exports) { 'use strict';
3885
5034
 
3886
5035
  var oneOf = { compile: compile$c, interpret: interpret$c, collectEvaluatedProperties: collectEvaluatedProperties$5, collectEvaluatedItems: collectEvaluatedItems$4 };
3887
5036
 
3888
- const { Schema: Schema$g, Instance: Instance$9 } = lib$1;
5037
+ const { Schema: Schema$g, Instance: Instance$9 } = lib$2;
3889
5038
 
3890
5039
 
3891
5040
  const compile$b = (schema) => new RegExp(Schema$g.value(schema), "u");
@@ -3893,8 +5042,8 @@ define(['exports'], (function (exports) { 'use strict';
3893
5042
 
3894
5043
  var pattern = { compile: compile$b, interpret: interpret$b };
3895
5044
 
3896
- const { Core: Core$d, Schema: Schema$f, Instance: Instance$8 } = lib$1;
3897
- const Pact$2 = lib$2;
5045
+ const { Core: Core$d, Schema: Schema$f, Instance: Instance$8 } = lib$2;
5046
+ const Pact$2 = lib$1;
3898
5047
 
3899
5048
 
3900
5049
  const compile$a = (schema, ast) => Pact$2.pipeline([
@@ -3931,8 +5080,8 @@ define(['exports'], (function (exports) { 'use strict';
3931
5080
 
3932
5081
  var common = { isObject, escapeRegExp: escapeRegExp$1, splitUrl: splitUrl$1 };
3933
5082
 
3934
- const { Core: Core$c, Schema: Schema$e, Instance: Instance$7 } = lib$1;
3935
- const Pact$1 = lib$2;
5083
+ const { Core: Core$c, Schema: Schema$e, Instance: Instance$7 } = lib$2;
5084
+ const Pact$1 = lib$1;
3936
5085
  const { escapeRegExp } = common;
3937
5086
 
3938
5087
 
@@ -3957,7 +5106,7 @@ define(['exports'], (function (exports) { 'use strict';
3957
5106
 
3958
5107
  var properties = { compile: compile$9, interpret: interpret$9, collectEvaluatedProperties: collectEvaluatedProperties$3 };
3959
5108
 
3960
- const { Core: Core$b, Instance: Instance$6 } = lib$1;
5109
+ const { Core: Core$b, Instance: Instance$6 } = lib$2;
3961
5110
 
3962
5111
 
3963
5112
  const compile$8 = (schema, ast) => Core$b.compileSchema(schema, ast);
@@ -3969,7 +5118,7 @@ define(['exports'], (function (exports) { 'use strict';
3969
5118
 
3970
5119
  var propertyNames = { compile: compile$8, interpret: interpret$8 };
3971
5120
 
3972
- const { Core: Core$a, Schema: Schema$d } = lib$1;
5121
+ const { Core: Core$a, Schema: Schema$d } = lib$2;
3973
5122
  const { splitUrl } = common;
3974
5123
 
3975
5124
 
@@ -3994,7 +5143,7 @@ define(['exports'], (function (exports) { 'use strict';
3994
5143
 
3995
5144
  var dynamicRef = { compile: compile$7, interpret: interpret$7, collectEvaluatedProperties: collectEvaluatedProperties$2, collectEvaluatedItems: collectEvaluatedItems$3 };
3996
5145
 
3997
- const { Core: Core$9, Schema: Schema$c } = lib$1;
5146
+ const { Core: Core$9, Schema: Schema$c } = lib$2;
3998
5147
 
3999
5148
 
4000
5149
  const compile$6 = async (ref, ast) => {
@@ -4008,7 +5157,7 @@ define(['exports'], (function (exports) { 'use strict';
4008
5157
 
4009
5158
  var ref = { compile: compile$6, interpret: interpret$6, collectEvaluatedProperties: collectEvaluatedProperties$1, collectEvaluatedItems: collectEvaluatedItems$2 };
4010
5159
 
4011
- const { Schema: Schema$b, Instance: Instance$5 } = lib$1;
5160
+ const { Schema: Schema$b, Instance: Instance$5 } = lib$2;
4012
5161
 
4013
5162
 
4014
5163
  const compile$5 = (schema) => Schema$b.value(schema);
@@ -4019,8 +5168,8 @@ define(['exports'], (function (exports) { 'use strict';
4019
5168
 
4020
5169
  var required = { compile: compile$5, interpret: interpret$5 };
4021
5170
 
4022
- const { Core: Core$8, Schema: Schema$a, Instance: Instance$4 } = lib$1;
4023
- const Pact = lib$2;
5171
+ const { Core: Core$8, Schema: Schema$a, Instance: Instance$4 } = lib$2;
5172
+ const Pact = lib$1;
4024
5173
 
4025
5174
 
4026
5175
  const compile$4 = (schema, ast) => {
@@ -4044,7 +5193,7 @@ define(['exports'], (function (exports) { 'use strict';
4044
5193
 
4045
5194
  var tupleItems = { compile: compile$4, interpret: interpret$4, collectEvaluatedItems: collectEvaluatedItems$1 };
4046
5195
 
4047
- const { Schema: Schema$9, Instance: Instance$3 } = lib$1;
5196
+ const { Schema: Schema$9, Instance: Instance$3 } = lib$2;
4048
5197
 
4049
5198
 
4050
5199
  const compile$3 = (schema) => Schema$9.value(schema);
@@ -4052,7 +5201,7 @@ define(['exports'], (function (exports) { 'use strict';
4052
5201
 
4053
5202
  var type = { compile: compile$3, interpret: interpret$3 };
4054
5203
 
4055
- const { Core: Core$7, Schema: Schema$8, Instance: Instance$2 } = lib$1;
5204
+ const { Core: Core$7, Schema: Schema$8, Instance: Instance$2 } = lib$2;
4056
5205
 
4057
5206
 
4058
5207
  const compile$2 = async (schema, ast, parentSchema) => {
@@ -4076,7 +5225,7 @@ define(['exports'], (function (exports) { 'use strict';
4076
5225
 
4077
5226
  var unevaluatedItems = { compile: compile$2, interpret: interpret$2, collectEvaluatedItems };
4078
5227
 
4079
- const { Core: Core$6, Schema: Schema$7, Instance: Instance$1 } = lib$1;
5228
+ const { Core: Core$6, Schema: Schema$7, Instance: Instance$1 } = lib$2;
4080
5229
 
4081
5230
 
4082
5231
  const compile$1 = async (schema, ast, parentSchema) => {
@@ -4101,7 +5250,7 @@ define(['exports'], (function (exports) { 'use strict';
4101
5250
 
4102
5251
  var unevaluatedProperties = { compile: compile$1, interpret: interpret$1, collectEvaluatedProperties };
4103
5252
 
4104
- const { Schema: Schema$6, Instance } = lib$1;
5253
+ const { Schema: Schema$6, Instance } = lib$2;
4105
5254
  const jsonStringify = fastestStableStringify;
4106
5255
 
4107
5256
 
@@ -4118,7 +5267,7 @@ define(['exports'], (function (exports) { 'use strict';
4118
5267
 
4119
5268
  var uniqueItems = { compile, interpret };
4120
5269
 
4121
- const { Keywords: Keywords$1 } = lib$1;
5270
+ const { Keywords: Keywords$1 } = lib$2;
4122
5271
 
4123
5272
 
4124
5273
  var keywords$5 = {
@@ -4324,7 +5473,7 @@ define(['exports'], (function (exports) { 'use strict';
4324
5473
  "default": {}
4325
5474
  }`;
4326
5475
 
4327
- const { Core: Core$5, Schema: Schema$5 } = lib$1;
5476
+ const { Core: Core$5, Schema: Schema$5 } = lib$2;
4328
5477
  const keywords$4 = keywords$5;
4329
5478
  const metaSchema$4 = schema$4;
4330
5479
 
@@ -4526,7 +5675,7 @@ define(['exports'], (function (exports) { 'use strict';
4526
5675
  "default": {}
4527
5676
  }`;
4528
5677
 
4529
- const { Core: Core$4, Schema: Schema$4 } = lib$1;
5678
+ const { Core: Core$4, Schema: Schema$4 } = lib$2;
4530
5679
  const keywords$3 = keywords$5;
4531
5680
  const metaSchema$3 = schema$3;
4532
5681
 
@@ -4751,7 +5900,7 @@ define(['exports'], (function (exports) { 'use strict';
4751
5900
  "default": true
4752
5901
  }`;
4753
5902
 
4754
- const { Core: Core$3, Schema: Schema$3 } = lib$1;
5903
+ const { Core: Core$3, Schema: Schema$3 } = lib$2;
4755
5904
  const keywords$2 = keywords$5;
4756
5905
  const metaSchema$2 = schema$2;
4757
5906
 
@@ -5134,7 +6283,7 @@ define(['exports'], (function (exports) { 'use strict';
5134
6283
  }
5135
6284
  }`;
5136
6285
 
5137
- const { Core: Core$2, Schema: Schema$2 } = lib$1;
6286
+ const { Core: Core$2, Schema: Schema$2 } = lib$2;
5138
6287
  const keywords$1 = keywords$5;
5139
6288
  const metaSchema$1 = schema$1;
5140
6289
  const coreMetaSchema$1 = core$1;
@@ -5581,7 +6730,7 @@ define(['exports'], (function (exports) { 'use strict';
5581
6730
  }
5582
6731
  }`;
5583
6732
 
5584
- const { Core: Core$1, Schema: Schema$1 } = lib$1;
6733
+ const { Core: Core$1, Schema: Schema$1 } = lib$2;
5585
6734
  const keywords = keywords$5;
5586
6735
  const metaSchema = schema;
5587
6736
  const coreMetaSchema = core;
@@ -5685,7 +6834,7 @@ define(['exports'], (function (exports) { 'use strict';
5685
6834
  "unevaluatedProperties": keywords.unevaluatedProperties
5686
6835
  });
5687
6836
 
5688
- const { Core, Schema, InvalidSchemaError } = lib$1;
6837
+ const { Core, Schema, InvalidSchemaError } = lib$2;
5689
6838
  const Keywords = keywords$5;
5690
6839
 
5691
6840