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