@swagger-api/apidom-json-path 1.0.0-alpha.8 → 1.0.0-beta.0

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.
@@ -19,9 +19,17 @@ __webpack_require__.r(__webpack_exports__);
19
19
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20
20
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
21
21
  /* harmony export */ });
22
- /* harmony import */ var _JsonPathError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(854);
22
+ /* harmony import */ var _JsonPathError_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(854);
23
23
 
24
- class EvaluationJsonPathError extends _JsonPathError__WEBPACK_IMPORTED_MODULE_0__["default"] {
24
+
25
+ /**
26
+ * @public
27
+ */
28
+
29
+ /**
30
+ * @public
31
+ */
32
+ class EvaluationJsonPathError extends _JsonPathError_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
25
33
  path;
26
34
  element;
27
35
  constructor(message, structuredOptions) {
@@ -44,8 +52,12 @@ __webpack_require__.r(__webpack_exports__);
44
52
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
45
53
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
46
54
  /* harmony export */ });
47
- /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2449);
55
+ /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4641);
48
56
 
57
+
58
+ /**
59
+ * @public
60
+ */
49
61
  class JsonPathError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"] {}
50
62
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JsonPathError);
51
63
 
@@ -59,9 +71,17 @@ __webpack_require__.r(__webpack_exports__);
59
71
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
60
72
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
61
73
  /* harmony export */ });
62
- /* harmony import */ var _JsonPathError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(854);
74
+ /* harmony import */ var _JsonPathError_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(854);
75
+
76
+
77
+ /**
78
+ * @public
79
+ */
63
80
 
64
- class MultiEvaluationJsonPathError extends _JsonPathError__WEBPACK_IMPORTED_MODULE_0__["default"] {
81
+ /**
82
+ * @public
83
+ */
84
+ class MultiEvaluationJsonPathError extends _JsonPathError_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
65
85
  paths;
66
86
  element;
67
87
  constructor(message, structuredOptions) {
@@ -85,16 +105,26 @@ __webpack_require__.r(__webpack_exports__);
85
105
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
86
106
  /* harmony export */ });
87
107
  /* harmony import */ var jsonpath_plus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3357);
88
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1514);
89
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4831);
90
- /* harmony import */ var _swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1581);
91
- /* harmony import */ var _errors_MultiEvaluationJsonPathError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(427);
108
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1776);
109
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6941);
110
+ /* harmony import */ var _swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7453);
111
+ /* harmony import */ var _errors_MultiEvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(427);
112
+
92
113
 
93
114
 
94
115
 
95
116
 
117
+ /**
118
+ * @public
119
+ */
120
+
121
+ /**
122
+ * @public
123
+ */
124
+
96
125
  /**
97
126
  * Evaluates multiple JSONPaths on ApiDOM element.
127
+ * @public
98
128
  */
99
129
  const evaluateMulti = (paths, element) => {
100
130
  try {
@@ -119,7 +149,7 @@ const evaluateMulti = (paths, element) => {
119
149
  }
120
150
  return results;
121
151
  } catch (error) {
122
- throw new _errors_MultiEvaluationJsonPathError__WEBPACK_IMPORTED_MODULE_3__["default"](`JSON Path evaluation failed while multi-evaluating "${String(paths)}".`, {
152
+ throw new _errors_MultiEvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`JSON Path evaluation failed while multi-evaluating "${String(paths)}".`, {
123
153
  paths,
124
154
  element: (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element),
125
155
  cause: error
@@ -139,16 +169,22 @@ __webpack_require__.r(__webpack_exports__);
139
169
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
140
170
  /* harmony export */ });
141
171
  /* harmony import */ var jsonpath_plus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3357);
142
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1514);
143
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4831);
144
- /* harmony import */ var _swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1581);
145
- /* harmony import */ var _errors_EvaluationJsonPathError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3424);
172
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1776);
173
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6941);
174
+ /* harmony import */ var _swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7453);
175
+ /* harmony import */ var _errors_EvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3424);
176
+
177
+
146
178
 
147
179
 
148
180
 
181
+ /**
182
+ * @public
183
+ */
149
184
 
150
185
  /**
151
186
  * Evaluates single JSONPath on ApiDOM element.
187
+ * @public
152
188
  */
153
189
  const evaluate = (path, element) => {
154
190
  try {
@@ -160,7 +196,7 @@ const evaluate = (path, element) => {
160
196
  });
161
197
  return pointers.map(pointer => (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_2__["default"])(pointer, element));
162
198
  } catch (error) {
163
- throw new _errors_EvaluationJsonPathError__WEBPACK_IMPORTED_MODULE_3__["default"](`JSON Path evaluation failed while evaluating "${String(path)}".`, {
199
+ throw new _errors_EvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`JSON Path evaluation failed while evaluating "${String(path)}".`, {
164
200
  path,
165
201
  element: (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element),
166
202
  cause: error
@@ -6018,6 +6054,7 @@ var createMethod = function (IS_INCLUDES) {
6018
6054
  return function ($this, el, fromIndex) {
6019
6055
  var O = toIndexedObject($this);
6020
6056
  var length = lengthOfArrayLike(O);
6057
+ if (length === 0) return !IS_INCLUDES && -1;
6021
6058
  var index = toAbsoluteIndex(fromIndex, length);
6022
6059
  var value;
6023
6060
  // Array#includes uses SameValueZero equality algorithm
@@ -6213,16 +6250,16 @@ module.exports = function (target, key, value, options) {
6213
6250
 
6214
6251
  "use strict";
6215
6252
 
6216
- var global = __webpack_require__(1063);
6253
+ var globalThis = __webpack_require__(8900);
6217
6254
 
6218
6255
  // eslint-disable-next-line es/no-object-defineproperty -- safe
6219
6256
  var defineProperty = Object.defineProperty;
6220
6257
 
6221
6258
  module.exports = function (key, value) {
6222
6259
  try {
6223
- defineProperty(global, key, { value: value, configurable: true, writable: true });
6260
+ defineProperty(globalThis, key, { value: value, configurable: true, writable: true });
6224
6261
  } catch (error) {
6225
- global[key] = value;
6262
+ globalThis[key] = value;
6226
6263
  } return value;
6227
6264
  };
6228
6265
 
@@ -6250,10 +6287,10 @@ module.exports = !fails(function () {
6250
6287
 
6251
6288
  "use strict";
6252
6289
 
6253
- var global = __webpack_require__(1063);
6290
+ var globalThis = __webpack_require__(8900);
6254
6291
  var isObject = __webpack_require__(262);
6255
6292
 
6256
- var document = global.document;
6293
+ var document = globalThis.document;
6257
6294
  // typeof document.createElement is 'object' in old IE
6258
6295
  var EXISTS = isObject(document) && isObject(document.createElement);
6259
6296
 
@@ -6308,26 +6345,50 @@ module.exports = {
6308
6345
 
6309
6346
  /***/ }),
6310
6347
 
6311
- /***/ 7868:
6348
+ /***/ 9683:
6312
6349
  /***/ ((module) => {
6313
6350
 
6314
6351
  "use strict";
6315
6352
 
6316
- module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
6353
+ // IE8- don't enum bug keys
6354
+ module.exports = [
6355
+ 'constructor',
6356
+ 'hasOwnProperty',
6357
+ 'isPrototypeOf',
6358
+ 'propertyIsEnumerable',
6359
+ 'toLocaleString',
6360
+ 'toString',
6361
+ 'valueOf'
6362
+ ];
6363
+
6364
+
6365
+ /***/ }),
6366
+
6367
+ /***/ 3531:
6368
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6369
+
6370
+ "use strict";
6371
+
6372
+ var globalThis = __webpack_require__(8900);
6373
+
6374
+ var navigator = globalThis.navigator;
6375
+ var userAgent = navigator && navigator.userAgent;
6376
+
6377
+ module.exports = userAgent ? String(userAgent) : '';
6317
6378
 
6318
6379
 
6319
6380
  /***/ }),
6320
6381
 
6321
- /***/ 4432:
6382
+ /***/ 5547:
6322
6383
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6323
6384
 
6324
6385
  "use strict";
6325
6386
 
6326
- var global = __webpack_require__(1063);
6327
- var userAgent = __webpack_require__(7868);
6387
+ var globalThis = __webpack_require__(8900);
6388
+ var userAgent = __webpack_require__(3531);
6328
6389
 
6329
- var process = global.process;
6330
- var Deno = global.Deno;
6390
+ var process = globalThis.process;
6391
+ var Deno = globalThis.Deno;
6331
6392
  var versions = process && process.versions || Deno && Deno.version;
6332
6393
  var v8 = versions && versions.v8;
6333
6394
  var match, version;
@@ -6352,25 +6413,6 @@ if (!version && userAgent) {
6352
6413
  module.exports = version;
6353
6414
 
6354
6415
 
6355
- /***/ }),
6356
-
6357
- /***/ 9683:
6358
- /***/ ((module) => {
6359
-
6360
- "use strict";
6361
-
6362
- // IE8- don't enum bug keys
6363
- module.exports = [
6364
- 'constructor',
6365
- 'hasOwnProperty',
6366
- 'isPrototypeOf',
6367
- 'propertyIsEnumerable',
6368
- 'toLocaleString',
6369
- 'toString',
6370
- 'valueOf'
6371
- ];
6372
-
6373
-
6374
6416
  /***/ }),
6375
6417
 
6376
6418
  /***/ 3885:
@@ -6384,7 +6426,7 @@ var $Error = Error;
6384
6426
  var replace = uncurryThis(''.replace);
6385
6427
 
6386
6428
  var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
6387
- // eslint-disable-next-line redos/no-vulnerable -- safe
6429
+ // eslint-disable-next-line redos/no-vulnerable, sonarjs/slow-regex -- safe
6388
6430
  var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
6389
6431
  var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
6390
6432
 
@@ -6443,7 +6485,7 @@ module.exports = !fails(function () {
6443
6485
 
6444
6486
  "use strict";
6445
6487
 
6446
- var global = __webpack_require__(1063);
6488
+ var globalThis = __webpack_require__(8900);
6447
6489
  var apply = __webpack_require__(7013);
6448
6490
  var uncurryThis = __webpack_require__(9344);
6449
6491
  var isCallable = __webpack_require__(2769);
@@ -6453,6 +6495,8 @@ var path = __webpack_require__(8099);
6453
6495
  var bind = __webpack_require__(4572);
6454
6496
  var createNonEnumerableProperty = __webpack_require__(3999);
6455
6497
  var hasOwn = __webpack_require__(701);
6498
+ // add debugging info
6499
+ __webpack_require__(3753);
6456
6500
 
6457
6501
  var wrapConstructor = function (NativeConstructor) {
6458
6502
  var Wrapper = function (a, b, c) {
@@ -6489,7 +6533,7 @@ module.exports = function (options, source) {
6489
6533
  var STATIC = options.stat;
6490
6534
  var PROTO = options.proto;
6491
6535
 
6492
- var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : global[TARGET] && global[TARGET].prototype;
6536
+ var nativeSource = GLOBAL ? globalThis : STATIC ? globalThis[TARGET] : globalThis[TARGET] && globalThis[TARGET].prototype;
6493
6537
 
6494
6538
  var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
6495
6539
  var targetPrototype = target.prototype;
@@ -6515,7 +6559,7 @@ module.exports = function (options, source) {
6515
6559
  if (!FORCED && !PROTO && typeof targetProperty == typeof sourceProperty) continue;
6516
6560
 
6517
6561
  // bind methods to global for calling from export context
6518
- if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
6562
+ if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, globalThis);
6519
6563
  // wrap global constructors for prevent changes in this version
6520
6564
  else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
6521
6565
  // make static versions for prototype methods
@@ -6726,7 +6770,7 @@ module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
6726
6770
  "use strict";
6727
6771
 
6728
6772
  var path = __webpack_require__(8099);
6729
- var global = __webpack_require__(1063);
6773
+ var globalThis = __webpack_require__(8900);
6730
6774
  var isCallable = __webpack_require__(2769);
6731
6775
 
6732
6776
  var aFunction = function (variable) {
@@ -6734,8 +6778,8 @@ var aFunction = function (variable) {
6734
6778
  };
6735
6779
 
6736
6780
  module.exports = function (namespace, method) {
6737
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
6738
- : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
6781
+ return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(globalThis[namespace])
6782
+ : path[namespace] && path[namespace][method] || globalThis[namespace] && globalThis[namespace][method];
6739
6783
  };
6740
6784
 
6741
6785
 
@@ -6803,7 +6847,7 @@ module.exports = function (V, P) {
6803
6847
 
6804
6848
  /***/ }),
6805
6849
 
6806
- /***/ 1063:
6850
+ /***/ 8900:
6807
6851
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
6808
6852
 
6809
6853
  "use strict";
@@ -6965,7 +7009,7 @@ module.exports = function (O, options) {
6965
7009
  "use strict";
6966
7010
 
6967
7011
  var NATIVE_WEAK_MAP = __webpack_require__(1314);
6968
- var global = __webpack_require__(1063);
7012
+ var globalThis = __webpack_require__(8900);
6969
7013
  var isObject = __webpack_require__(262);
6970
7014
  var createNonEnumerableProperty = __webpack_require__(3999);
6971
7015
  var hasOwn = __webpack_require__(701);
@@ -6974,8 +7018,8 @@ var sharedKey = __webpack_require__(4275);
6974
7018
  var hiddenKeys = __webpack_require__(5241);
6975
7019
 
6976
7020
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
6977
- var TypeError = global.TypeError;
6978
- var WeakMap = global.WeakMap;
7021
+ var TypeError = globalThis.TypeError;
7022
+ var WeakMap = globalThis.WeakMap;
6979
7023
  var set, get, has;
6980
7024
 
6981
7025
  var enforce = function (it) {
@@ -7572,7 +7616,8 @@ var NullProtoObjectViaActiveX = function (activeXDocument) {
7572
7616
  activeXDocument.write(scriptTag(''));
7573
7617
  activeXDocument.close();
7574
7618
  var temp = activeXDocument.parentWindow.Object;
7575
- activeXDocument = null; // avoid memory leak
7619
+ // eslint-disable-next-line no-useless-assignment -- avoid memory leak
7620
+ activeXDocument = null;
7576
7621
  return temp;
7577
7622
  };
7578
7623
 
@@ -7894,7 +7939,8 @@ exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
7894
7939
 
7895
7940
  /* eslint-disable no-proto -- safe */
7896
7941
  var uncurryThisAccessor = __webpack_require__(3574);
7897
- var anObject = __webpack_require__(7235);
7942
+ var isObject = __webpack_require__(262);
7943
+ var requireObjectCoercible = __webpack_require__(5426);
7898
7944
  var aPossiblePrototype = __webpack_require__(1966);
7899
7945
 
7900
7946
  // `Object.setPrototypeOf` method
@@ -7911,8 +7957,9 @@ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
7911
7957
  CORRECT_SETTER = test instanceof Array;
7912
7958
  } catch (error) { /* empty */ }
7913
7959
  return function setPrototypeOf(O, proto) {
7914
- anObject(O);
7960
+ requireObjectCoercible(O);
7915
7961
  aPossiblePrototype(proto);
7962
+ if (!isObject(O)) return O;
7916
7963
  if (CORRECT_SETTER) setter(O, proto);
7917
7964
  else O.__proto__ = proto;
7918
7965
  return O;
@@ -8084,13 +8131,20 @@ module.exports = function (key) {
8084
8131
 
8085
8132
  "use strict";
8086
8133
 
8087
- var global = __webpack_require__(1063);
8134
+ var IS_PURE = __webpack_require__(4871);
8135
+ var globalThis = __webpack_require__(8900);
8088
8136
  var defineGlobalProperty = __webpack_require__(7525);
8089
8137
 
8090
8138
  var SHARED = '__core-js_shared__';
8091
- var store = global[SHARED] || defineGlobalProperty(SHARED, {});
8139
+ var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
8092
8140
 
8093
- module.exports = store;
8141
+ (store.versions || (store.versions = [])).push({
8142
+ version: '3.39.0',
8143
+ mode: IS_PURE ? 'pure' : 'global',
8144
+ copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
8145
+ license: 'https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE',
8146
+ source: 'https://github.com/zloirock/core-js'
8147
+ });
8094
8148
 
8095
8149
 
8096
8150
  /***/ }),
@@ -8100,18 +8154,11 @@ module.exports = store;
8100
8154
 
8101
8155
  "use strict";
8102
8156
 
8103
- var IS_PURE = __webpack_require__(4871);
8104
8157
  var store = __webpack_require__(3753);
8105
8158
 
8106
- (module.exports = function (key, value) {
8107
- return store[key] || (store[key] = value !== undefined ? value : {});
8108
- })('versions', []).push({
8109
- version: '3.35.1',
8110
- mode: IS_PURE ? 'pure' : 'global',
8111
- copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
8112
- license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
8113
- source: 'https://github.com/zloirock/core-js'
8114
- });
8159
+ module.exports = function (key, value) {
8160
+ return store[key] || (store[key] = value || {});
8161
+ };
8115
8162
 
8116
8163
 
8117
8164
  /***/ }),
@@ -8167,11 +8214,11 @@ module.exports = {
8167
8214
  "use strict";
8168
8215
 
8169
8216
  /* eslint-disable es/no-symbol -- required for testing */
8170
- var V8_VERSION = __webpack_require__(4432);
8217
+ var V8_VERSION = __webpack_require__(5547);
8171
8218
  var fails = __webpack_require__(1203);
8172
- var global = __webpack_require__(1063);
8219
+ var globalThis = __webpack_require__(8900);
8173
8220
 
8174
- var $String = global.String;
8221
+ var $String = globalThis.String;
8175
8222
 
8176
8223
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
8177
8224
  module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
@@ -8410,9 +8457,9 @@ module.exports = function (key) {
8410
8457
  /* eslint-disable es/no-symbol -- required for testing */
8411
8458
  var NATIVE_SYMBOL = __webpack_require__(4603);
8412
8459
 
8413
- module.exports = NATIVE_SYMBOL
8414
- && !Symbol.sham
8415
- && typeof Symbol.iterator == 'symbol';
8460
+ module.exports = NATIVE_SYMBOL &&
8461
+ !Symbol.sham &&
8462
+ typeof Symbol.iterator == 'symbol';
8416
8463
 
8417
8464
 
8418
8465
  /***/ }),
@@ -8443,10 +8490,10 @@ module.exports = DESCRIPTORS && fails(function () {
8443
8490
 
8444
8491
  "use strict";
8445
8492
 
8446
- var global = __webpack_require__(1063);
8493
+ var globalThis = __webpack_require__(8900);
8447
8494
  var isCallable = __webpack_require__(2769);
8448
8495
 
8449
- var WeakMap = global.WeakMap;
8496
+ var WeakMap = globalThis.WeakMap;
8450
8497
 
8451
8498
  module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
8452
8499
 
@@ -8458,14 +8505,14 @@ module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
8458
8505
 
8459
8506
  "use strict";
8460
8507
 
8461
- var global = __webpack_require__(1063);
8508
+ var globalThis = __webpack_require__(8900);
8462
8509
  var shared = __webpack_require__(8141);
8463
8510
  var hasOwn = __webpack_require__(701);
8464
8511
  var uid = __webpack_require__(1268);
8465
8512
  var NATIVE_SYMBOL = __webpack_require__(4603);
8466
8513
  var USE_SYMBOL_AS_UID = __webpack_require__(7460);
8467
8514
 
8468
- var Symbol = global.Symbol;
8515
+ var Symbol = globalThis.Symbol;
8469
8516
  var WellKnownSymbolsStore = shared('wks');
8470
8517
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
8471
8518
 
@@ -8697,7 +8744,7 @@ module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
8697
8744
  var target = state.target;
8698
8745
  var index = state.index++;
8699
8746
  if (!target || index >= target.length) {
8700
- state.target = undefined;
8747
+ state.target = null;
8701
8748
  return createIterResultObject(undefined, true);
8702
8749
  }
8703
8750
  switch (state.kind) {
@@ -8731,12 +8778,12 @@ if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
8731
8778
 
8732
8779
  /* eslint-disable no-unused-vars -- required for functions `.length` */
8733
8780
  var $ = __webpack_require__(9098);
8734
- var global = __webpack_require__(1063);
8781
+ var globalThis = __webpack_require__(8900);
8735
8782
  var apply = __webpack_require__(7013);
8736
8783
  var wrapErrorConstructorWithCause = __webpack_require__(6453);
8737
8784
 
8738
8785
  var WEB_ASSEMBLY = 'WebAssembly';
8739
- var WebAssembly = global[WEB_ASSEMBLY];
8786
+ var WebAssembly = globalThis[WEB_ASSEMBLY];
8740
8787
 
8741
8788
  // eslint-disable-next-line es/no-error-cause -- feature detection
8742
8789
  var FORCED = new Error('e', { cause: 7 }).cause !== 7;
@@ -8847,12 +8894,12 @@ __webpack_require__(5695);
8847
8894
 
8848
8895
  __webpack_require__(9828);
8849
8896
  var DOMIterables = __webpack_require__(1100);
8850
- var global = __webpack_require__(1063);
8897
+ var globalThis = __webpack_require__(8900);
8851
8898
  var setToStringTag = __webpack_require__(1811);
8852
8899
  var Iterators = __webpack_require__(6625);
8853
8900
 
8854
8901
  for (var COLLECTION_NAME in DOMIterables) {
8855
- setToStringTag(global[COLLECTION_NAME], COLLECTION_NAME);
8902
+ setToStringTag(globalThis[COLLECTION_NAME], COLLECTION_NAME);
8856
8903
  Iterators[COLLECTION_NAME] = Iterators.Array;
8857
8904
  }
8858
8905
 
@@ -8883,272 +8930,1382 @@ __webpack_require__.r(__webpack_exports__);
8883
8930
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8884
8931
  /* harmony export */ JSONPath: () => (/* binding */ JSONPath)
8885
8932
  /* harmony export */ });
8886
- function _typeof(obj) {
8887
- "@babel/helpers - typeof";
8888
-
8889
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
8890
- return typeof obj;
8891
- } : function (obj) {
8892
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
8893
- }, _typeof(obj);
8894
- }
8895
-
8896
- function _classCallCheck(instance, Constructor) {
8897
- if (!(instance instanceof Constructor)) {
8898
- throw new TypeError("Cannot call a class as a function");
8933
+ /**
8934
+ * @implements {IHooks}
8935
+ */
8936
+ class Hooks {
8937
+ /**
8938
+ * @callback HookCallback
8939
+ * @this {*|Jsep} this
8940
+ * @param {Jsep} env
8941
+ * @returns: void
8942
+ */
8943
+ /**
8944
+ * Adds the given callback to the list of callbacks for the given hook.
8945
+ *
8946
+ * The callback will be invoked when the hook it is registered for is run.
8947
+ *
8948
+ * One callback function can be registered to multiple hooks and the same hook multiple times.
8949
+ *
8950
+ * @param {string|object} name The name of the hook, or an object of callbacks keyed by name
8951
+ * @param {HookCallback|boolean} callback The callback function which is given environment variables.
8952
+ * @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom)
8953
+ * @public
8954
+ */
8955
+ add(name, callback, first) {
8956
+ if (typeof arguments[0] != 'string') {
8957
+ // Multiple hook callbacks, keyed by name
8958
+ for (let name in arguments[0]) {
8959
+ this.add(name, arguments[0][name], arguments[1]);
8960
+ }
8961
+ } else {
8962
+ (Array.isArray(name) ? name : [name]).forEach(function (name) {
8963
+ this[name] = this[name] || [];
8964
+ if (callback) {
8965
+ this[name][first ? 'unshift' : 'push'](callback);
8966
+ }
8967
+ }, this);
8968
+ }
8899
8969
  }
8900
- }
8901
8970
 
8902
- function _defineProperties(target, props) {
8903
- for (var i = 0; i < props.length; i++) {
8904
- var descriptor = props[i];
8905
- descriptor.enumerable = descriptor.enumerable || false;
8906
- descriptor.configurable = true;
8907
- if ("value" in descriptor) descriptor.writable = true;
8908
- Object.defineProperty(target, descriptor.key, descriptor);
8971
+ /**
8972
+ * Runs a hook invoking all registered callbacks with the given environment variables.
8973
+ *
8974
+ * Callbacks will be invoked synchronously and in the order in which they were registered.
8975
+ *
8976
+ * @param {string} name The name of the hook.
8977
+ * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
8978
+ * @public
8979
+ */
8980
+ run(name, env) {
8981
+ this[name] = this[name] || [];
8982
+ this[name].forEach(function (callback) {
8983
+ callback.call(env && env.context ? env.context : env, env);
8984
+ });
8909
8985
  }
8910
8986
  }
8911
8987
 
8912
- function _createClass(Constructor, protoProps, staticProps) {
8913
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
8914
- if (staticProps) _defineProperties(Constructor, staticProps);
8915
- Object.defineProperty(Constructor, "prototype", {
8916
- writable: false
8917
- });
8918
- return Constructor;
8919
- }
8920
-
8921
- function _inherits(subClass, superClass) {
8922
- if (typeof superClass !== "function" && superClass !== null) {
8923
- throw new TypeError("Super expression must either be null or a function");
8988
+ /**
8989
+ * @implements {IPlugins}
8990
+ */
8991
+ class Plugins {
8992
+ constructor(jsep) {
8993
+ this.jsep = jsep;
8994
+ this.registered = {};
8924
8995
  }
8925
8996
 
8926
- subClass.prototype = Object.create(superClass && superClass.prototype, {
8927
- constructor: {
8928
- value: subClass,
8929
- writable: true,
8930
- configurable: true
8997
+ /**
8998
+ * @callback PluginSetup
8999
+ * @this {Jsep} jsep
9000
+ * @returns: void
9001
+ */
9002
+ /**
9003
+ * Adds the given plugin(s) to the registry
9004
+ *
9005
+ * @param {object} plugins
9006
+ * @param {string} plugins.name The name of the plugin
9007
+ * @param {PluginSetup} plugins.init The init function
9008
+ * @public
9009
+ */
9010
+ register() {
9011
+ for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
9012
+ plugins[_key] = arguments[_key];
8931
9013
  }
8932
- });
8933
- Object.defineProperty(subClass, "prototype", {
8934
- writable: false
8935
- });
8936
- if (superClass) _setPrototypeOf(subClass, superClass);
8937
- }
8938
-
8939
- function _getPrototypeOf(o) {
8940
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
8941
- return o.__proto__ || Object.getPrototypeOf(o);
8942
- };
8943
- return _getPrototypeOf(o);
8944
- }
8945
-
8946
- function _setPrototypeOf(o, p) {
8947
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
8948
- o.__proto__ = p;
8949
- return o;
8950
- };
8951
- return _setPrototypeOf(o, p);
9014
+ plugins.forEach(plugin => {
9015
+ if (typeof plugin !== 'object' || !plugin.name || !plugin.init) {
9016
+ throw new Error('Invalid JSEP plugin format');
9017
+ }
9018
+ if (this.registered[plugin.name]) {
9019
+ // already registered. Ignore.
9020
+ return;
9021
+ }
9022
+ plugin.init(this.jsep);
9023
+ this.registered[plugin.name] = plugin;
9024
+ });
9025
+ }
8952
9026
  }
8953
9027
 
8954
- function _isNativeReflectConstruct() {
8955
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
8956
- if (Reflect.construct.sham) return false;
8957
- if (typeof Proxy === "function") return true;
9028
+ // JavaScript Expression Parser (JSEP) 1.4.0
8958
9029
 
8959
- try {
8960
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
8961
- return true;
8962
- } catch (e) {
8963
- return false;
9030
+ class Jsep {
9031
+ /**
9032
+ * @returns {string}
9033
+ */
9034
+ static get version() {
9035
+ // To be filled in by the template
9036
+ return '1.4.0';
8964
9037
  }
8965
- }
8966
9038
 
8967
- function _construct(Parent, args, Class) {
8968
- if (_isNativeReflectConstruct()) {
8969
- _construct = Reflect.construct.bind();
8970
- } else {
8971
- _construct = function _construct(Parent, args, Class) {
8972
- var a = [null];
8973
- a.push.apply(a, args);
8974
- var Constructor = Function.bind.apply(Parent, a);
8975
- var instance = new Constructor();
8976
- if (Class) _setPrototypeOf(instance, Class.prototype);
8977
- return instance;
8978
- };
9039
+ /**
9040
+ * @returns {string}
9041
+ */
9042
+ static toString() {
9043
+ return 'JavaScript Expression Parser (JSEP) v' + Jsep.version;
9044
+ }
9045
+ // ==================== CONFIG ================================
9046
+ /**
9047
+ * @method addUnaryOp
9048
+ * @param {string} op_name The name of the unary op to add
9049
+ * @returns {Jsep}
9050
+ */
9051
+ static addUnaryOp(op_name) {
9052
+ Jsep.max_unop_len = Math.max(op_name.length, Jsep.max_unop_len);
9053
+ Jsep.unary_ops[op_name] = 1;
9054
+ return Jsep;
8979
9055
  }
8980
9056
 
8981
- return _construct.apply(null, arguments);
8982
- }
8983
-
8984
- function _isNativeFunction(fn) {
8985
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
8986
- }
8987
-
8988
- function _wrapNativeSuper(Class) {
8989
- var _cache = typeof Map === "function" ? new Map() : undefined;
8990
-
8991
- _wrapNativeSuper = function _wrapNativeSuper(Class) {
8992
- if (Class === null || !_isNativeFunction(Class)) return Class;
8993
-
8994
- if (typeof Class !== "function") {
8995
- throw new TypeError("Super expression must either be null or a function");
9057
+ /**
9058
+ * @method jsep.addBinaryOp
9059
+ * @param {string} op_name The name of the binary op to add
9060
+ * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence
9061
+ * @param {boolean} [isRightAssociative=false] whether operator is right-associative
9062
+ * @returns {Jsep}
9063
+ */
9064
+ static addBinaryOp(op_name, precedence, isRightAssociative) {
9065
+ Jsep.max_binop_len = Math.max(op_name.length, Jsep.max_binop_len);
9066
+ Jsep.binary_ops[op_name] = precedence;
9067
+ if (isRightAssociative) {
9068
+ Jsep.right_associative.add(op_name);
9069
+ } else {
9070
+ Jsep.right_associative.delete(op_name);
8996
9071
  }
9072
+ return Jsep;
9073
+ }
8997
9074
 
8998
- if (typeof _cache !== "undefined") {
8999
- if (_cache.has(Class)) return _cache.get(Class);
9075
+ /**
9076
+ * @method addIdentifierChar
9077
+ * @param {string} char The additional character to treat as a valid part of an identifier
9078
+ * @returns {Jsep}
9079
+ */
9080
+ static addIdentifierChar(char) {
9081
+ Jsep.additional_identifier_chars.add(char);
9082
+ return Jsep;
9083
+ }
9000
9084
 
9001
- _cache.set(Class, Wrapper);
9002
- }
9085
+ /**
9086
+ * @method addLiteral
9087
+ * @param {string} literal_name The name of the literal to add
9088
+ * @param {*} literal_value The value of the literal
9089
+ * @returns {Jsep}
9090
+ */
9091
+ static addLiteral(literal_name, literal_value) {
9092
+ Jsep.literals[literal_name] = literal_value;
9093
+ return Jsep;
9094
+ }
9003
9095
 
9004
- function Wrapper() {
9005
- return _construct(Class, arguments, _getPrototypeOf(this).constructor);
9096
+ /**
9097
+ * @method removeUnaryOp
9098
+ * @param {string} op_name The name of the unary op to remove
9099
+ * @returns {Jsep}
9100
+ */
9101
+ static removeUnaryOp(op_name) {
9102
+ delete Jsep.unary_ops[op_name];
9103
+ if (op_name.length === Jsep.max_unop_len) {
9104
+ Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);
9006
9105
  }
9007
-
9008
- Wrapper.prototype = Object.create(Class.prototype, {
9009
- constructor: {
9010
- value: Wrapper,
9011
- enumerable: false,
9012
- writable: true,
9013
- configurable: true
9014
- }
9015
- });
9016
- return _setPrototypeOf(Wrapper, Class);
9017
- };
9018
-
9019
- return _wrapNativeSuper(Class);
9020
- }
9021
-
9022
- function _assertThisInitialized(self) {
9023
- if (self === void 0) {
9024
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9106
+ return Jsep;
9025
9107
  }
9026
9108
 
9027
- return self;
9028
- }
9029
-
9030
- function _possibleConstructorReturn(self, call) {
9031
- if (call && (typeof call === "object" || typeof call === "function")) {
9032
- return call;
9033
- } else if (call !== void 0) {
9034
- throw new TypeError("Derived constructors may only return object or undefined");
9109
+ /**
9110
+ * @method removeAllUnaryOps
9111
+ * @returns {Jsep}
9112
+ */
9113
+ static removeAllUnaryOps() {
9114
+ Jsep.unary_ops = {};
9115
+ Jsep.max_unop_len = 0;
9116
+ return Jsep;
9035
9117
  }
9036
9118
 
9037
- return _assertThisInitialized(self);
9038
- }
9039
-
9040
- function _createSuper(Derived) {
9041
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
9042
-
9043
- return function _createSuperInternal() {
9044
- var Super = _getPrototypeOf(Derived),
9045
- result;
9046
-
9047
- if (hasNativeReflectConstruct) {
9048
- var NewTarget = _getPrototypeOf(this).constructor;
9119
+ /**
9120
+ * @method removeIdentifierChar
9121
+ * @param {string} char The additional character to stop treating as a valid part of an identifier
9122
+ * @returns {Jsep}
9123
+ */
9124
+ static removeIdentifierChar(char) {
9125
+ Jsep.additional_identifier_chars.delete(char);
9126
+ return Jsep;
9127
+ }
9049
9128
 
9050
- result = Reflect.construct(Super, arguments, NewTarget);
9051
- } else {
9052
- result = Super.apply(this, arguments);
9129
+ /**
9130
+ * @method removeBinaryOp
9131
+ * @param {string} op_name The name of the binary op to remove
9132
+ * @returns {Jsep}
9133
+ */
9134
+ static removeBinaryOp(op_name) {
9135
+ delete Jsep.binary_ops[op_name];
9136
+ if (op_name.length === Jsep.max_binop_len) {
9137
+ Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);
9053
9138
  }
9139
+ Jsep.right_associative.delete(op_name);
9140
+ return Jsep;
9141
+ }
9054
9142
 
9055
- return _possibleConstructorReturn(this, result);
9056
- };
9057
- }
9143
+ /**
9144
+ * @method removeAllBinaryOps
9145
+ * @returns {Jsep}
9146
+ */
9147
+ static removeAllBinaryOps() {
9148
+ Jsep.binary_ops = {};
9149
+ Jsep.max_binop_len = 0;
9150
+ return Jsep;
9151
+ }
9058
9152
 
9059
- function _toConsumableArray(arr) {
9060
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
9061
- }
9153
+ /**
9154
+ * @method removeLiteral
9155
+ * @param {string} literal_name The name of the literal to remove
9156
+ * @returns {Jsep}
9157
+ */
9158
+ static removeLiteral(literal_name) {
9159
+ delete Jsep.literals[literal_name];
9160
+ return Jsep;
9161
+ }
9062
9162
 
9063
- function _arrayWithoutHoles(arr) {
9064
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
9065
- }
9163
+ /**
9164
+ * @method removeAllLiterals
9165
+ * @returns {Jsep}
9166
+ */
9167
+ static removeAllLiterals() {
9168
+ Jsep.literals = {};
9169
+ return Jsep;
9170
+ }
9171
+ // ==================== END CONFIG ============================
9066
9172
 
9067
- function _iterableToArray(iter) {
9068
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
9069
- }
9173
+ /**
9174
+ * @returns {string}
9175
+ */
9176
+ get char() {
9177
+ return this.expr.charAt(this.index);
9178
+ }
9070
9179
 
9071
- function _unsupportedIterableToArray(o, minLen) {
9072
- if (!o) return;
9073
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
9074
- var n = Object.prototype.toString.call(o).slice(8, -1);
9075
- if (n === "Object" && o.constructor) n = o.constructor.name;
9076
- if (n === "Map" || n === "Set") return Array.from(o);
9077
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
9078
- }
9180
+ /**
9181
+ * @returns {number}
9182
+ */
9183
+ get code() {
9184
+ return this.expr.charCodeAt(this.index);
9185
+ }
9186
+ /**
9187
+ * @param {string} expr a string with the passed in express
9188
+ * @returns Jsep
9189
+ */
9190
+ constructor(expr) {
9191
+ // `index` stores the character number we are currently at
9192
+ // All of the gobbles below will modify `index` as we move along
9193
+ this.expr = expr;
9194
+ this.index = 0;
9195
+ }
9079
9196
 
9080
- function _arrayLikeToArray(arr, len) {
9081
- if (len == null || len > arr.length) len = arr.length;
9197
+ /**
9198
+ * static top-level parser
9199
+ * @returns {jsep.Expression}
9200
+ */
9201
+ static parse(expr) {
9202
+ return new Jsep(expr).parse();
9203
+ }
9082
9204
 
9083
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
9205
+ /**
9206
+ * Get the longest key length of any object
9207
+ * @param {object} obj
9208
+ * @returns {number}
9209
+ */
9210
+ static getMaxKeyLen(obj) {
9211
+ return Math.max(0, ...Object.keys(obj).map(k => k.length));
9212
+ }
9084
9213
 
9085
- return arr2;
9086
- }
9214
+ /**
9215
+ * `ch` is a character code in the next three functions
9216
+ * @param {number} ch
9217
+ * @returns {boolean}
9218
+ */
9219
+ static isDecimalDigit(ch) {
9220
+ return ch >= 48 && ch <= 57; // 0...9
9221
+ }
9087
9222
 
9088
- function _nonIterableSpread() {
9089
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9090
- }
9223
+ /**
9224
+ * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float.
9225
+ * @param {string} op_val
9226
+ * @returns {number}
9227
+ */
9228
+ static binaryPrecedence(op_val) {
9229
+ return Jsep.binary_ops[op_val] || 0;
9230
+ }
9091
9231
 
9092
- function _createForOfIteratorHelper(o, allowArrayLike) {
9093
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
9232
+ /**
9233
+ * Looks for start of identifier
9234
+ * @param {number} ch
9235
+ * @returns {boolean}
9236
+ */
9237
+ static isIdentifierStart(ch) {
9238
+ return ch >= 65 && ch <= 90 ||
9239
+ // A...Z
9240
+ ch >= 97 && ch <= 122 ||
9241
+ // a...z
9242
+ ch >= 128 && !Jsep.binary_ops[String.fromCharCode(ch)] ||
9243
+ // any non-ASCII that is not an operator
9244
+ Jsep.additional_identifier_chars.has(String.fromCharCode(ch)); // additional characters
9245
+ }
9094
9246
 
9095
- if (!it) {
9096
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
9097
- if (it) o = it;
9098
- var i = 0;
9247
+ /**
9248
+ * @param {number} ch
9249
+ * @returns {boolean}
9250
+ */
9251
+ static isIdentifierPart(ch) {
9252
+ return Jsep.isIdentifierStart(ch) || Jsep.isDecimalDigit(ch);
9253
+ }
9099
9254
 
9100
- var F = function () {};
9255
+ /**
9256
+ * throw error at index of the expression
9257
+ * @param {string} message
9258
+ * @throws
9259
+ */
9260
+ throwError(message) {
9261
+ const error = new Error(message + ' at character ' + this.index);
9262
+ error.index = this.index;
9263
+ error.description = message;
9264
+ throw error;
9265
+ }
9101
9266
 
9102
- return {
9103
- s: F,
9104
- n: function () {
9105
- if (i >= o.length) return {
9106
- done: true
9107
- };
9108
- return {
9109
- done: false,
9110
- value: o[i++]
9111
- };
9112
- },
9113
- e: function (e) {
9114
- throw e;
9115
- },
9116
- f: F
9267
+ /**
9268
+ * Run a given hook
9269
+ * @param {string} name
9270
+ * @param {jsep.Expression|false} [node]
9271
+ * @returns {?jsep.Expression}
9272
+ */
9273
+ runHook(name, node) {
9274
+ if (Jsep.hooks[name]) {
9275
+ const env = {
9276
+ context: this,
9277
+ node
9117
9278
  };
9279
+ Jsep.hooks.run(name, env);
9280
+ return env.node;
9118
9281
  }
9282
+ return node;
9283
+ }
9119
9284
 
9120
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9285
+ /**
9286
+ * Runs a given hook until one returns a node
9287
+ * @param {string} name
9288
+ * @returns {?jsep.Expression}
9289
+ */
9290
+ searchHook(name) {
9291
+ if (Jsep.hooks[name]) {
9292
+ const env = {
9293
+ context: this
9294
+ };
9295
+ Jsep.hooks[name].find(function (callback) {
9296
+ callback.call(env.context, env);
9297
+ return env.node;
9298
+ });
9299
+ return env.node;
9300
+ }
9121
9301
  }
9122
9302
 
9123
- var normalCompletion = true,
9124
- didErr = false,
9125
- err;
9126
- return {
9127
- s: function () {
9128
- it = it.call(o);
9129
- },
9130
- n: function () {
9131
- var step = it.next();
9132
- normalCompletion = step.done;
9133
- return step;
9134
- },
9135
- e: function (e) {
9136
- didErr = true;
9137
- err = e;
9138
- },
9139
- f: function () {
9140
- try {
9141
- if (!normalCompletion && it.return != null) it.return();
9142
- } finally {
9143
- if (didErr) throw err;
9144
- }
9303
+ /**
9304
+ * Push `index` up to the next non-space character
9305
+ */
9306
+ gobbleSpaces() {
9307
+ let ch = this.code;
9308
+ // Whitespace
9309
+ while (ch === Jsep.SPACE_CODE || ch === Jsep.TAB_CODE || ch === Jsep.LF_CODE || ch === Jsep.CR_CODE) {
9310
+ ch = this.expr.charCodeAt(++this.index);
9145
9311
  }
9146
- };
9147
- }
9312
+ this.runHook('gobble-spaces');
9313
+ }
9314
+
9315
+ /**
9316
+ * Top-level method to parse all expressions and returns compound or single node
9317
+ * @returns {jsep.Expression}
9318
+ */
9319
+ parse() {
9320
+ this.runHook('before-all');
9321
+ const nodes = this.gobbleExpressions();
9322
+
9323
+ // If there's only one expression just try returning the expression
9324
+ const node = nodes.length === 1 ? nodes[0] : {
9325
+ type: Jsep.COMPOUND,
9326
+ body: nodes
9327
+ };
9328
+ return this.runHook('after-all', node);
9329
+ }
9330
+
9331
+ /**
9332
+ * top-level parser (but can be reused within as well)
9333
+ * @param {number} [untilICode]
9334
+ * @returns {jsep.Expression[]}
9335
+ */
9336
+ gobbleExpressions(untilICode) {
9337
+ let nodes = [],
9338
+ ch_i,
9339
+ node;
9340
+ while (this.index < this.expr.length) {
9341
+ ch_i = this.code;
9342
+
9343
+ // Expressions can be separated by semicolons, commas, or just inferred without any
9344
+ // separators
9345
+ if (ch_i === Jsep.SEMCOL_CODE || ch_i === Jsep.COMMA_CODE) {
9346
+ this.index++; // ignore separators
9347
+ } else {
9348
+ // Try to gobble each expression individually
9349
+ if (node = this.gobbleExpression()) {
9350
+ nodes.push(node);
9351
+ // If we weren't able to find a binary expression and are out of room, then
9352
+ // the expression passed in probably has too much
9353
+ } else if (this.index < this.expr.length) {
9354
+ if (ch_i === untilICode) {
9355
+ break;
9356
+ }
9357
+ this.throwError('Unexpected "' + this.char + '"');
9358
+ }
9359
+ }
9360
+ }
9361
+ return nodes;
9362
+ }
9363
+
9364
+ /**
9365
+ * The main parsing function.
9366
+ * @returns {?jsep.Expression}
9367
+ */
9368
+ gobbleExpression() {
9369
+ const node = this.searchHook('gobble-expression') || this.gobbleBinaryExpression();
9370
+ this.gobbleSpaces();
9371
+ return this.runHook('after-expression', node);
9372
+ }
9373
+
9374
+ /**
9375
+ * Search for the operation portion of the string (e.g. `+`, `===`)
9376
+ * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)
9377
+ * and move down from 3 to 2 to 1 character until a matching binary operation is found
9378
+ * then, return that binary operation
9379
+ * @returns {string|boolean}
9380
+ */
9381
+ gobbleBinaryOp() {
9382
+ this.gobbleSpaces();
9383
+ let to_check = this.expr.substr(this.index, Jsep.max_binop_len);
9384
+ let tc_len = to_check.length;
9385
+ while (tc_len > 0) {
9386
+ // Don't accept a binary op when it is an identifier.
9387
+ // Binary ops that start with a identifier-valid character must be followed
9388
+ // by a non identifier-part valid character
9389
+ if (Jsep.binary_ops.hasOwnProperty(to_check) && (!Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) {
9390
+ this.index += tc_len;
9391
+ return to_check;
9392
+ }
9393
+ to_check = to_check.substr(0, --tc_len);
9394
+ }
9395
+ return false;
9396
+ }
9397
+
9398
+ /**
9399
+ * This function is responsible for gobbling an individual expression,
9400
+ * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`
9401
+ * @returns {?jsep.BinaryExpression}
9402
+ */
9403
+ gobbleBinaryExpression() {
9404
+ let node, biop, prec, stack, biop_info, left, right, i, cur_biop;
9405
+
9406
+ // First, try to get the leftmost thing
9407
+ // Then, check to see if there's a binary operator operating on that leftmost thing
9408
+ // Don't gobbleBinaryOp without a left-hand-side
9409
+ left = this.gobbleToken();
9410
+ if (!left) {
9411
+ return left;
9412
+ }
9413
+ biop = this.gobbleBinaryOp();
9414
+
9415
+ // If there wasn't a binary operator, just return the leftmost node
9416
+ if (!biop) {
9417
+ return left;
9418
+ }
9419
+
9420
+ // Otherwise, we need to start a stack to properly place the binary operations in their
9421
+ // precedence structure
9422
+ biop_info = {
9423
+ value: biop,
9424
+ prec: Jsep.binaryPrecedence(biop),
9425
+ right_a: Jsep.right_associative.has(biop)
9426
+ };
9427
+ right = this.gobbleToken();
9428
+ if (!right) {
9429
+ this.throwError("Expected expression after " + biop);
9430
+ }
9431
+ stack = [left, biop_info, right];
9432
+
9433
+ // Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)
9434
+ while (biop = this.gobbleBinaryOp()) {
9435
+ prec = Jsep.binaryPrecedence(biop);
9436
+ if (prec === 0) {
9437
+ this.index -= biop.length;
9438
+ break;
9439
+ }
9440
+ biop_info = {
9441
+ value: biop,
9442
+ prec,
9443
+ right_a: Jsep.right_associative.has(biop)
9444
+ };
9445
+ cur_biop = biop;
9446
+
9447
+ // Reduce: make a binary expression from the three topmost entries.
9448
+ const comparePrev = prev => biop_info.right_a && prev.right_a ? prec > prev.prec : prec <= prev.prec;
9449
+ while (stack.length > 2 && comparePrev(stack[stack.length - 2])) {
9450
+ right = stack.pop();
9451
+ biop = stack.pop().value;
9452
+ left = stack.pop();
9453
+ node = {
9454
+ type: Jsep.BINARY_EXP,
9455
+ operator: biop,
9456
+ left,
9457
+ right
9458
+ };
9459
+ stack.push(node);
9460
+ }
9461
+ node = this.gobbleToken();
9462
+ if (!node) {
9463
+ this.throwError("Expected expression after " + cur_biop);
9464
+ }
9465
+ stack.push(biop_info, node);
9466
+ }
9467
+ i = stack.length - 1;
9468
+ node = stack[i];
9469
+ while (i > 1) {
9470
+ node = {
9471
+ type: Jsep.BINARY_EXP,
9472
+ operator: stack[i - 1].value,
9473
+ left: stack[i - 2],
9474
+ right: node
9475
+ };
9476
+ i -= 2;
9477
+ }
9478
+ return node;
9479
+ }
9480
+
9481
+ /**
9482
+ * An individual part of a binary expression:
9483
+ * e.g. `foo.bar(baz)`, `1`, `"abc"`, `(a % 2)` (because it's in parenthesis)
9484
+ * @returns {boolean|jsep.Expression}
9485
+ */
9486
+ gobbleToken() {
9487
+ let ch, to_check, tc_len, node;
9488
+ this.gobbleSpaces();
9489
+ node = this.searchHook('gobble-token');
9490
+ if (node) {
9491
+ return this.runHook('after-token', node);
9492
+ }
9493
+ ch = this.code;
9494
+ if (Jsep.isDecimalDigit(ch) || ch === Jsep.PERIOD_CODE) {
9495
+ // Char code 46 is a dot `.` which can start off a numeric literal
9496
+ return this.gobbleNumericLiteral();
9497
+ }
9498
+ if (ch === Jsep.SQUOTE_CODE || ch === Jsep.DQUOTE_CODE) {
9499
+ // Single or double quotes
9500
+ node = this.gobbleStringLiteral();
9501
+ } else if (ch === Jsep.OBRACK_CODE) {
9502
+ node = this.gobbleArray();
9503
+ } else {
9504
+ to_check = this.expr.substr(this.index, Jsep.max_unop_len);
9505
+ tc_len = to_check.length;
9506
+ while (tc_len > 0) {
9507
+ // Don't accept an unary op when it is an identifier.
9508
+ // Unary ops that start with a identifier-valid character must be followed
9509
+ // by a non identifier-part valid character
9510
+ if (Jsep.unary_ops.hasOwnProperty(to_check) && (!Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) {
9511
+ this.index += tc_len;
9512
+ const argument = this.gobbleToken();
9513
+ if (!argument) {
9514
+ this.throwError('missing unaryOp argument');
9515
+ }
9516
+ return this.runHook('after-token', {
9517
+ type: Jsep.UNARY_EXP,
9518
+ operator: to_check,
9519
+ argument,
9520
+ prefix: true
9521
+ });
9522
+ }
9523
+ to_check = to_check.substr(0, --tc_len);
9524
+ }
9525
+ if (Jsep.isIdentifierStart(ch)) {
9526
+ node = this.gobbleIdentifier();
9527
+ if (Jsep.literals.hasOwnProperty(node.name)) {
9528
+ node = {
9529
+ type: Jsep.LITERAL,
9530
+ value: Jsep.literals[node.name],
9531
+ raw: node.name
9532
+ };
9533
+ } else if (node.name === Jsep.this_str) {
9534
+ node = {
9535
+ type: Jsep.THIS_EXP
9536
+ };
9537
+ }
9538
+ } else if (ch === Jsep.OPAREN_CODE) {
9539
+ // open parenthesis
9540
+ node = this.gobbleGroup();
9541
+ }
9542
+ }
9543
+ if (!node) {
9544
+ return this.runHook('after-token', false);
9545
+ }
9546
+ node = this.gobbleTokenProperty(node);
9547
+ return this.runHook('after-token', node);
9548
+ }
9549
+
9550
+ /**
9551
+ * Gobble properties of of identifiers/strings/arrays/groups.
9552
+ * e.g. `foo`, `bar.baz`, `foo['bar'].baz`
9553
+ * It also gobbles function calls:
9554
+ * e.g. `Math.acos(obj.angle)`
9555
+ * @param {jsep.Expression} node
9556
+ * @returns {jsep.Expression}
9557
+ */
9558
+ gobbleTokenProperty(node) {
9559
+ this.gobbleSpaces();
9560
+ let ch = this.code;
9561
+ while (ch === Jsep.PERIOD_CODE || ch === Jsep.OBRACK_CODE || ch === Jsep.OPAREN_CODE || ch === Jsep.QUMARK_CODE) {
9562
+ let optional;
9563
+ if (ch === Jsep.QUMARK_CODE) {
9564
+ if (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE) {
9565
+ break;
9566
+ }
9567
+ optional = true;
9568
+ this.index += 2;
9569
+ this.gobbleSpaces();
9570
+ ch = this.code;
9571
+ }
9572
+ this.index++;
9573
+ if (ch === Jsep.OBRACK_CODE) {
9574
+ node = {
9575
+ type: Jsep.MEMBER_EXP,
9576
+ computed: true,
9577
+ object: node,
9578
+ property: this.gobbleExpression()
9579
+ };
9580
+ if (!node.property) {
9581
+ this.throwError('Unexpected "' + this.char + '"');
9582
+ }
9583
+ this.gobbleSpaces();
9584
+ ch = this.code;
9585
+ if (ch !== Jsep.CBRACK_CODE) {
9586
+ this.throwError('Unclosed [');
9587
+ }
9588
+ this.index++;
9589
+ } else if (ch === Jsep.OPAREN_CODE) {
9590
+ // A function call is being made; gobble all the arguments
9591
+ node = {
9592
+ type: Jsep.CALL_EXP,
9593
+ 'arguments': this.gobbleArguments(Jsep.CPAREN_CODE),
9594
+ callee: node
9595
+ };
9596
+ } else if (ch === Jsep.PERIOD_CODE || optional) {
9597
+ if (optional) {
9598
+ this.index--;
9599
+ }
9600
+ this.gobbleSpaces();
9601
+ node = {
9602
+ type: Jsep.MEMBER_EXP,
9603
+ computed: false,
9604
+ object: node,
9605
+ property: this.gobbleIdentifier()
9606
+ };
9607
+ }
9608
+ if (optional) {
9609
+ node.optional = true;
9610
+ } // else leave undefined for compatibility with esprima
9611
+
9612
+ this.gobbleSpaces();
9613
+ ch = this.code;
9614
+ }
9615
+ return node;
9616
+ }
9617
+
9618
+ /**
9619
+ * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to
9620
+ * keep track of everything in the numeric literal and then calling `parseFloat` on that string
9621
+ * @returns {jsep.Literal}
9622
+ */
9623
+ gobbleNumericLiteral() {
9624
+ let number = '',
9625
+ ch,
9626
+ chCode;
9627
+ while (Jsep.isDecimalDigit(this.code)) {
9628
+ number += this.expr.charAt(this.index++);
9629
+ }
9630
+ if (this.code === Jsep.PERIOD_CODE) {
9631
+ // can start with a decimal marker
9632
+ number += this.expr.charAt(this.index++);
9633
+ while (Jsep.isDecimalDigit(this.code)) {
9634
+ number += this.expr.charAt(this.index++);
9635
+ }
9636
+ }
9637
+ ch = this.char;
9638
+ if (ch === 'e' || ch === 'E') {
9639
+ // exponent marker
9640
+ number += this.expr.charAt(this.index++);
9641
+ ch = this.char;
9642
+ if (ch === '+' || ch === '-') {
9643
+ // exponent sign
9644
+ number += this.expr.charAt(this.index++);
9645
+ }
9646
+ while (Jsep.isDecimalDigit(this.code)) {
9647
+ // exponent itself
9648
+ number += this.expr.charAt(this.index++);
9649
+ }
9650
+ if (!Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1))) {
9651
+ this.throwError('Expected exponent (' + number + this.char + ')');
9652
+ }
9653
+ }
9654
+ chCode = this.code;
9655
+
9656
+ // Check to make sure this isn't a variable name that start with a number (123abc)
9657
+ if (Jsep.isIdentifierStart(chCode)) {
9658
+ this.throwError('Variable names cannot start with a number (' + number + this.char + ')');
9659
+ } else if (chCode === Jsep.PERIOD_CODE || number.length === 1 && number.charCodeAt(0) === Jsep.PERIOD_CODE) {
9660
+ this.throwError('Unexpected period');
9661
+ }
9662
+ return {
9663
+ type: Jsep.LITERAL,
9664
+ value: parseFloat(number),
9665
+ raw: number
9666
+ };
9667
+ }
9668
+
9669
+ /**
9670
+ * Parses a string literal, staring with single or double quotes with basic support for escape codes
9671
+ * e.g. `"hello world"`, `'this is\nJSEP'`
9672
+ * @returns {jsep.Literal}
9673
+ */
9674
+ gobbleStringLiteral() {
9675
+ let str = '';
9676
+ const startIndex = this.index;
9677
+ const quote = this.expr.charAt(this.index++);
9678
+ let closed = false;
9679
+ while (this.index < this.expr.length) {
9680
+ let ch = this.expr.charAt(this.index++);
9681
+ if (ch === quote) {
9682
+ closed = true;
9683
+ break;
9684
+ } else if (ch === '\\') {
9685
+ // Check for all of the common escape codes
9686
+ ch = this.expr.charAt(this.index++);
9687
+ switch (ch) {
9688
+ case 'n':
9689
+ str += '\n';
9690
+ break;
9691
+ case 'r':
9692
+ str += '\r';
9693
+ break;
9694
+ case 't':
9695
+ str += '\t';
9696
+ break;
9697
+ case 'b':
9698
+ str += '\b';
9699
+ break;
9700
+ case 'f':
9701
+ str += '\f';
9702
+ break;
9703
+ case 'v':
9704
+ str += '\x0B';
9705
+ break;
9706
+ default:
9707
+ str += ch;
9708
+ }
9709
+ } else {
9710
+ str += ch;
9711
+ }
9712
+ }
9713
+ if (!closed) {
9714
+ this.throwError('Unclosed quote after "' + str + '"');
9715
+ }
9716
+ return {
9717
+ type: Jsep.LITERAL,
9718
+ value: str,
9719
+ raw: this.expr.substring(startIndex, this.index)
9720
+ };
9721
+ }
9722
+
9723
+ /**
9724
+ * Gobbles only identifiers
9725
+ * e.g.: `foo`, `_value`, `$x1`
9726
+ * Also, this function checks if that identifier is a literal:
9727
+ * (e.g. `true`, `false`, `null`) or `this`
9728
+ * @returns {jsep.Identifier}
9729
+ */
9730
+ gobbleIdentifier() {
9731
+ let ch = this.code,
9732
+ start = this.index;
9733
+ if (Jsep.isIdentifierStart(ch)) {
9734
+ this.index++;
9735
+ } else {
9736
+ this.throwError('Unexpected ' + this.char);
9737
+ }
9738
+ while (this.index < this.expr.length) {
9739
+ ch = this.code;
9740
+ if (Jsep.isIdentifierPart(ch)) {
9741
+ this.index++;
9742
+ } else {
9743
+ break;
9744
+ }
9745
+ }
9746
+ return {
9747
+ type: Jsep.IDENTIFIER,
9748
+ name: this.expr.slice(start, this.index)
9749
+ };
9750
+ }
9751
+
9752
+ /**
9753
+ * Gobbles a list of arguments within the context of a function call
9754
+ * or array literal. This function also assumes that the opening character
9755
+ * `(` or `[` has already been gobbled, and gobbles expressions and commas
9756
+ * until the terminator character `)` or `]` is encountered.
9757
+ * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`
9758
+ * @param {number} termination
9759
+ * @returns {jsep.Expression[]}
9760
+ */
9761
+ gobbleArguments(termination) {
9762
+ const args = [];
9763
+ let closed = false;
9764
+ let separator_count = 0;
9765
+ while (this.index < this.expr.length) {
9766
+ this.gobbleSpaces();
9767
+ let ch_i = this.code;
9768
+ if (ch_i === termination) {
9769
+ // done parsing
9770
+ closed = true;
9771
+ this.index++;
9772
+ if (termination === Jsep.CPAREN_CODE && separator_count && separator_count >= args.length) {
9773
+ this.throwError('Unexpected token ' + String.fromCharCode(termination));
9774
+ }
9775
+ break;
9776
+ } else if (ch_i === Jsep.COMMA_CODE) {
9777
+ // between expressions
9778
+ this.index++;
9779
+ separator_count++;
9780
+ if (separator_count !== args.length) {
9781
+ // missing argument
9782
+ if (termination === Jsep.CPAREN_CODE) {
9783
+ this.throwError('Unexpected token ,');
9784
+ } else if (termination === Jsep.CBRACK_CODE) {
9785
+ for (let arg = args.length; arg < separator_count; arg++) {
9786
+ args.push(null);
9787
+ }
9788
+ }
9789
+ }
9790
+ } else if (args.length !== separator_count && separator_count !== 0) {
9791
+ // NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments
9792
+ this.throwError('Expected comma');
9793
+ } else {
9794
+ const node = this.gobbleExpression();
9795
+ if (!node || node.type === Jsep.COMPOUND) {
9796
+ this.throwError('Expected comma');
9797
+ }
9798
+ args.push(node);
9799
+ }
9800
+ }
9801
+ if (!closed) {
9802
+ this.throwError('Expected ' + String.fromCharCode(termination));
9803
+ }
9804
+ return args;
9805
+ }
9806
+
9807
+ /**
9808
+ * Responsible for parsing a group of things within parentheses `()`
9809
+ * that have no identifier in front (so not a function call)
9810
+ * This function assumes that it needs to gobble the opening parenthesis
9811
+ * and then tries to gobble everything within that parenthesis, assuming
9812
+ * that the next thing it should see is the close parenthesis. If not,
9813
+ * then the expression probably doesn't have a `)`
9814
+ * @returns {boolean|jsep.Expression}
9815
+ */
9816
+ gobbleGroup() {
9817
+ this.index++;
9818
+ let nodes = this.gobbleExpressions(Jsep.CPAREN_CODE);
9819
+ if (this.code === Jsep.CPAREN_CODE) {
9820
+ this.index++;
9821
+ if (nodes.length === 1) {
9822
+ return nodes[0];
9823
+ } else if (!nodes.length) {
9824
+ return false;
9825
+ } else {
9826
+ return {
9827
+ type: Jsep.SEQUENCE_EXP,
9828
+ expressions: nodes
9829
+ };
9830
+ }
9831
+ } else {
9832
+ this.throwError('Unclosed (');
9833
+ }
9834
+ }
9835
+
9836
+ /**
9837
+ * Responsible for parsing Array literals `[1, 2, 3]`
9838
+ * This function assumes that it needs to gobble the opening bracket
9839
+ * and then tries to gobble the expressions as arguments.
9840
+ * @returns {jsep.ArrayExpression}
9841
+ */
9842
+ gobbleArray() {
9843
+ this.index++;
9844
+ return {
9845
+ type: Jsep.ARRAY_EXP,
9846
+ elements: this.gobbleArguments(Jsep.CBRACK_CODE)
9847
+ };
9848
+ }
9849
+ }
9850
+
9851
+ // Static fields:
9852
+ const hooks = new Hooks();
9853
+ Object.assign(Jsep, {
9854
+ hooks,
9855
+ plugins: new Plugins(Jsep),
9856
+ // Node Types
9857
+ // ----------
9858
+ // This is the full set of types that any JSEP node can be.
9859
+ // Store them here to save space when minified
9860
+ COMPOUND: 'Compound',
9861
+ SEQUENCE_EXP: 'SequenceExpression',
9862
+ IDENTIFIER: 'Identifier',
9863
+ MEMBER_EXP: 'MemberExpression',
9864
+ LITERAL: 'Literal',
9865
+ THIS_EXP: 'ThisExpression',
9866
+ CALL_EXP: 'CallExpression',
9867
+ UNARY_EXP: 'UnaryExpression',
9868
+ BINARY_EXP: 'BinaryExpression',
9869
+ ARRAY_EXP: 'ArrayExpression',
9870
+ TAB_CODE: 9,
9871
+ LF_CODE: 10,
9872
+ CR_CODE: 13,
9873
+ SPACE_CODE: 32,
9874
+ PERIOD_CODE: 46,
9875
+ // '.'
9876
+ COMMA_CODE: 44,
9877
+ // ','
9878
+ SQUOTE_CODE: 39,
9879
+ // single quote
9880
+ DQUOTE_CODE: 34,
9881
+ // double quotes
9882
+ OPAREN_CODE: 40,
9883
+ // (
9884
+ CPAREN_CODE: 41,
9885
+ // )
9886
+ OBRACK_CODE: 91,
9887
+ // [
9888
+ CBRACK_CODE: 93,
9889
+ // ]
9890
+ QUMARK_CODE: 63,
9891
+ // ?
9892
+ SEMCOL_CODE: 59,
9893
+ // ;
9894
+ COLON_CODE: 58,
9895
+ // :
9896
+
9897
+ // Operations
9898
+ // ----------
9899
+ // Use a quickly-accessible map to store all of the unary operators
9900
+ // Values are set to `1` (it really doesn't matter)
9901
+ unary_ops: {
9902
+ '-': 1,
9903
+ '!': 1,
9904
+ '~': 1,
9905
+ '+': 1
9906
+ },
9907
+ // Also use a map for the binary operations but set their values to their
9908
+ // binary precedence for quick reference (higher number = higher precedence)
9909
+ // see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)
9910
+ binary_ops: {
9911
+ '||': 1,
9912
+ '??': 1,
9913
+ '&&': 2,
9914
+ '|': 3,
9915
+ '^': 4,
9916
+ '&': 5,
9917
+ '==': 6,
9918
+ '!=': 6,
9919
+ '===': 6,
9920
+ '!==': 6,
9921
+ '<': 7,
9922
+ '>': 7,
9923
+ '<=': 7,
9924
+ '>=': 7,
9925
+ '<<': 8,
9926
+ '>>': 8,
9927
+ '>>>': 8,
9928
+ '+': 9,
9929
+ '-': 9,
9930
+ '*': 10,
9931
+ '/': 10,
9932
+ '%': 10,
9933
+ '**': 11
9934
+ },
9935
+ // sets specific binary_ops as right-associative
9936
+ right_associative: new Set(['**']),
9937
+ // Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char)
9938
+ additional_identifier_chars: new Set(['$', '_']),
9939
+ // Literals
9940
+ // ----------
9941
+ // Store the values to return for the various literals we may encounter
9942
+ literals: {
9943
+ 'true': true,
9944
+ 'false': false,
9945
+ 'null': null
9946
+ },
9947
+ // Except for `this`, which is special. This could be changed to something like `'self'` as well
9948
+ this_str: 'this'
9949
+ });
9950
+ Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);
9951
+ Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);
9952
+
9953
+ // Backward Compatibility:
9954
+ const jsep = expr => new Jsep(expr).parse();
9955
+ const stdClassProps = Object.getOwnPropertyNames(class Test {});
9956
+ Object.getOwnPropertyNames(Jsep).filter(prop => !stdClassProps.includes(prop) && jsep[prop] === undefined).forEach(m => {
9957
+ jsep[m] = Jsep[m];
9958
+ });
9959
+ jsep.Jsep = Jsep; // allows for const { Jsep } = require('jsep');
9960
+
9961
+ const CONDITIONAL_EXP = 'ConditionalExpression';
9962
+ var ternary = {
9963
+ name: 'ternary',
9964
+ init(jsep) {
9965
+ // Ternary expression: test ? consequent : alternate
9966
+ jsep.hooks.add('after-expression', function gobbleTernary(env) {
9967
+ if (env.node && this.code === jsep.QUMARK_CODE) {
9968
+ this.index++;
9969
+ const test = env.node;
9970
+ const consequent = this.gobbleExpression();
9971
+ if (!consequent) {
9972
+ this.throwError('Expected expression');
9973
+ }
9974
+ this.gobbleSpaces();
9975
+ if (this.code === jsep.COLON_CODE) {
9976
+ this.index++;
9977
+ const alternate = this.gobbleExpression();
9978
+ if (!alternate) {
9979
+ this.throwError('Expected expression');
9980
+ }
9981
+ env.node = {
9982
+ type: CONDITIONAL_EXP,
9983
+ test,
9984
+ consequent,
9985
+ alternate
9986
+ };
9987
+
9988
+ // check for operators of higher priority than ternary (i.e. assignment)
9989
+ // jsep sets || at 1, and assignment at 0.9, and conditional should be between them
9990
+ if (test.operator && jsep.binary_ops[test.operator] <= 0.9) {
9991
+ let newTest = test;
9992
+ while (newTest.right.operator && jsep.binary_ops[newTest.right.operator] <= 0.9) {
9993
+ newTest = newTest.right;
9994
+ }
9995
+ env.node.test = newTest.right;
9996
+ newTest.right = env.node;
9997
+ env.node = test;
9998
+ }
9999
+ } else {
10000
+ this.throwError('Expected :');
10001
+ }
10002
+ }
10003
+ });
10004
+ }
10005
+ };
10006
+
10007
+ // Add default plugins:
10008
+
10009
+ jsep.plugins.register(ternary);
10010
+
10011
+ const FSLASH_CODE = 47; // '/'
10012
+ const BSLASH_CODE = 92; // '\\'
10013
+
10014
+ var index = {
10015
+ name: 'regex',
10016
+ init(jsep) {
10017
+ // Regex literal: /abc123/ig
10018
+ jsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {
10019
+ if (this.code === FSLASH_CODE) {
10020
+ const patternIndex = ++this.index;
10021
+ let inCharSet = false;
10022
+ while (this.index < this.expr.length) {
10023
+ if (this.code === FSLASH_CODE && !inCharSet) {
10024
+ const pattern = this.expr.slice(patternIndex, this.index);
10025
+ let flags = '';
10026
+ while (++this.index < this.expr.length) {
10027
+ const code = this.code;
10028
+ if (code >= 97 && code <= 122 // a...z
10029
+ || code >= 65 && code <= 90 // A...Z
10030
+ || code >= 48 && code <= 57) {
10031
+ // 0-9
10032
+ flags += this.char;
10033
+ } else {
10034
+ break;
10035
+ }
10036
+ }
10037
+ let value;
10038
+ try {
10039
+ value = new RegExp(pattern, flags);
10040
+ } catch (e) {
10041
+ this.throwError(e.message);
10042
+ }
10043
+ env.node = {
10044
+ type: jsep.LITERAL,
10045
+ value,
10046
+ raw: this.expr.slice(patternIndex - 1, this.index)
10047
+ };
10048
+
10049
+ // allow . [] and () after regex: /regex/.test(a)
10050
+ env.node = this.gobbleTokenProperty(env.node);
10051
+ return env.node;
10052
+ }
10053
+ if (this.code === jsep.OBRACK_CODE) {
10054
+ inCharSet = true;
10055
+ } else if (inCharSet && this.code === jsep.CBRACK_CODE) {
10056
+ inCharSet = false;
10057
+ }
10058
+ this.index += this.code === BSLASH_CODE ? 2 : 1;
10059
+ }
10060
+ this.throwError('Unclosed Regex');
10061
+ }
10062
+ });
10063
+ }
10064
+ };
10065
+
10066
+ const PLUS_CODE = 43; // +
10067
+ const MINUS_CODE = 45; // -
10068
+
10069
+ const plugin = {
10070
+ name: 'assignment',
10071
+ assignmentOperators: new Set(['=', '*=', '**=', '/=', '%=', '+=', '-=', '<<=', '>>=', '>>>=', '&=', '^=', '|=', '||=', '&&=', '??=']),
10072
+ updateOperators: [PLUS_CODE, MINUS_CODE],
10073
+ assignmentPrecedence: 0.9,
10074
+ init(jsep) {
10075
+ const updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];
10076
+ plugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));
10077
+ jsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {
10078
+ const code = this.code;
10079
+ if (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {
10080
+ this.index += 2;
10081
+ env.node = {
10082
+ type: 'UpdateExpression',
10083
+ operator: code === PLUS_CODE ? '++' : '--',
10084
+ argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
10085
+ prefix: true
10086
+ };
10087
+ if (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {
10088
+ this.throwError(`Unexpected ${env.node.operator}`);
10089
+ }
10090
+ }
10091
+ });
10092
+ jsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {
10093
+ if (env.node) {
10094
+ const code = this.code;
10095
+ if (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {
10096
+ if (!updateNodeTypes.includes(env.node.type)) {
10097
+ this.throwError(`Unexpected ${env.node.operator}`);
10098
+ }
10099
+ this.index += 2;
10100
+ env.node = {
10101
+ type: 'UpdateExpression',
10102
+ operator: code === PLUS_CODE ? '++' : '--',
10103
+ argument: env.node,
10104
+ prefix: false
10105
+ };
10106
+ }
10107
+ }
10108
+ });
10109
+ jsep.hooks.add('after-expression', function gobbleAssignment(env) {
10110
+ if (env.node) {
10111
+ // Note: Binaries can be chained in a single expression to respect
10112
+ // operator precedence (i.e. a = b = 1 + 2 + 3)
10113
+ // Update all binary assignment nodes in the tree
10114
+ updateBinariesToAssignments(env.node);
10115
+ }
10116
+ });
10117
+ function updateBinariesToAssignments(node) {
10118
+ if (plugin.assignmentOperators.has(node.operator)) {
10119
+ node.type = 'AssignmentExpression';
10120
+ updateBinariesToAssignments(node.left);
10121
+ updateBinariesToAssignments(node.right);
10122
+ } else if (!node.operator) {
10123
+ Object.values(node).forEach(val => {
10124
+ if (val && typeof val === 'object') {
10125
+ updateBinariesToAssignments(val);
10126
+ }
10127
+ });
10128
+ }
10129
+ }
10130
+ }
10131
+ };
10132
+
10133
+ /* eslint-disable no-bitwise -- Convenient */
10134
+
10135
+ // register plugins
10136
+ jsep.plugins.register(index, plugin);
10137
+ jsep.addUnaryOp('typeof');
10138
+ jsep.addLiteral('null', null);
10139
+ jsep.addLiteral('undefined', undefined);
10140
+ const BLOCKED_PROTO_PROPERTIES = new Set(['constructor', '__proto__', '__defineGetter__', '__defineSetter__']);
10141
+ const SafeEval = {
10142
+ /**
10143
+ * @param {jsep.Expression} ast
10144
+ * @param {Record<string, any>} subs
10145
+ */
10146
+ evalAst(ast, subs) {
10147
+ switch (ast.type) {
10148
+ case 'BinaryExpression':
10149
+ case 'LogicalExpression':
10150
+ return SafeEval.evalBinaryExpression(ast, subs);
10151
+ case 'Compound':
10152
+ return SafeEval.evalCompound(ast, subs);
10153
+ case 'ConditionalExpression':
10154
+ return SafeEval.evalConditionalExpression(ast, subs);
10155
+ case 'Identifier':
10156
+ return SafeEval.evalIdentifier(ast, subs);
10157
+ case 'Literal':
10158
+ return SafeEval.evalLiteral(ast, subs);
10159
+ case 'MemberExpression':
10160
+ return SafeEval.evalMemberExpression(ast, subs);
10161
+ case 'UnaryExpression':
10162
+ return SafeEval.evalUnaryExpression(ast, subs);
10163
+ case 'ArrayExpression':
10164
+ return SafeEval.evalArrayExpression(ast, subs);
10165
+ case 'CallExpression':
10166
+ return SafeEval.evalCallExpression(ast, subs);
10167
+ case 'AssignmentExpression':
10168
+ return SafeEval.evalAssignmentExpression(ast, subs);
10169
+ default:
10170
+ throw SyntaxError('Unexpected expression', ast);
10171
+ }
10172
+ },
10173
+ evalBinaryExpression(ast, subs) {
10174
+ const result = {
10175
+ '||': (a, b) => a || b(),
10176
+ '&&': (a, b) => a && b(),
10177
+ '|': (a, b) => a | b(),
10178
+ '^': (a, b) => a ^ b(),
10179
+ '&': (a, b) => a & b(),
10180
+ // eslint-disable-next-line eqeqeq -- API
10181
+ '==': (a, b) => a == b(),
10182
+ // eslint-disable-next-line eqeqeq -- API
10183
+ '!=': (a, b) => a != b(),
10184
+ '===': (a, b) => a === b(),
10185
+ '!==': (a, b) => a !== b(),
10186
+ '<': (a, b) => a < b(),
10187
+ '>': (a, b) => a > b(),
10188
+ '<=': (a, b) => a <= b(),
10189
+ '>=': (a, b) => a >= b(),
10190
+ '<<': (a, b) => a << b(),
10191
+ '>>': (a, b) => a >> b(),
10192
+ '>>>': (a, b) => a >>> b(),
10193
+ '+': (a, b) => a + b(),
10194
+ '-': (a, b) => a - b(),
10195
+ '*': (a, b) => a * b(),
10196
+ '/': (a, b) => a / b(),
10197
+ '%': (a, b) => a % b()
10198
+ }[ast.operator](SafeEval.evalAst(ast.left, subs), () => SafeEval.evalAst(ast.right, subs));
10199
+ return result;
10200
+ },
10201
+ evalCompound(ast, subs) {
10202
+ let last;
10203
+ for (let i = 0; i < ast.body.length; i++) {
10204
+ if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(ast.body[i].name) && ast.body[i + 1] && ast.body[i + 1].type === 'AssignmentExpression') {
10205
+ // var x=2; is detected as
10206
+ // [{Identifier var}, {AssignmentExpression x=2}]
10207
+ // eslint-disable-next-line @stylistic/max-len -- Long
10208
+ // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient
10209
+ i += 1;
10210
+ }
10211
+ const expr = ast.body[i];
10212
+ last = SafeEval.evalAst(expr, subs);
10213
+ }
10214
+ return last;
10215
+ },
10216
+ evalConditionalExpression(ast, subs) {
10217
+ if (SafeEval.evalAst(ast.test, subs)) {
10218
+ return SafeEval.evalAst(ast.consequent, subs);
10219
+ }
10220
+ return SafeEval.evalAst(ast.alternate, subs);
10221
+ },
10222
+ evalIdentifier(ast, subs) {
10223
+ if (Object.hasOwn(subs, ast.name)) {
10224
+ return subs[ast.name];
10225
+ }
10226
+ throw ReferenceError(`${ast.name} is not defined`);
10227
+ },
10228
+ evalLiteral(ast) {
10229
+ return ast.value;
10230
+ },
10231
+ evalMemberExpression(ast, subs) {
10232
+ const prop = ast.computed ? SafeEval.evalAst(ast.property) // `object[property]`
10233
+ : ast.property.name; // `object.property` property is Identifier
10234
+ const obj = SafeEval.evalAst(ast.object, subs);
10235
+ if (obj === undefined || obj === null) {
10236
+ throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`);
10237
+ }
10238
+ if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) {
10239
+ throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`);
10240
+ }
10241
+ const result = obj[prop];
10242
+ if (typeof result === 'function') {
10243
+ return result.bind(obj); // arrow functions aren't affected by bind.
10244
+ }
10245
+ return result;
10246
+ },
10247
+ evalUnaryExpression(ast, subs) {
10248
+ const result = {
10249
+ '-': a => -SafeEval.evalAst(a, subs),
10250
+ '!': a => !SafeEval.evalAst(a, subs),
10251
+ '~': a => ~SafeEval.evalAst(a, subs),
10252
+ // eslint-disable-next-line no-implicit-coercion -- API
10253
+ '+': a => +SafeEval.evalAst(a, subs),
10254
+ typeof: a => typeof SafeEval.evalAst(a, subs)
10255
+ }[ast.operator](ast.argument);
10256
+ return result;
10257
+ },
10258
+ evalArrayExpression(ast, subs) {
10259
+ return ast.elements.map(el => SafeEval.evalAst(el, subs));
10260
+ },
10261
+ evalCallExpression(ast, subs) {
10262
+ const args = ast.arguments.map(arg => SafeEval.evalAst(arg, subs));
10263
+ const func = SafeEval.evalAst(ast.callee, subs);
10264
+ // if (func === Function) {
10265
+ // throw new Error('Function constructor is disabled');
10266
+ // }
10267
+ return func(...args);
10268
+ },
10269
+ evalAssignmentExpression(ast, subs) {
10270
+ if (ast.left.type !== 'Identifier') {
10271
+ throw SyntaxError('Invalid left-hand side in assignment');
10272
+ }
10273
+ const id = ast.left.name;
10274
+ const value = SafeEval.evalAst(ast.right, subs);
10275
+ subs[id] = value;
10276
+ return subs[id];
10277
+ }
10278
+ };
9148
10279
 
9149
- var hasOwnProp = Object.prototype.hasOwnProperty;
9150
10280
  /**
9151
- * @typedef {null|boolean|number|string|PlainObject|GenericArray} JSONObject
10281
+ * A replacement for NodeJS' VM.Script which is also {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | Content Security Policy} friendly.
10282
+ */
10283
+ class SafeScript {
10284
+ /**
10285
+ * @param {string} expr Expression to evaluate
10286
+ */
10287
+ constructor(expr) {
10288
+ this.code = expr;
10289
+ this.ast = jsep(this.code);
10290
+ }
10291
+
10292
+ /**
10293
+ * @param {object} context Object whose items will be added
10294
+ * to evaluation
10295
+ * @returns {EvaluatedResult} Result of evaluated code
10296
+ */
10297
+ runInNewContext(context) {
10298
+ // `Object.create(null)` creates a prototypeless object
10299
+ const keyMap = Object.assign(Object.create(null), context);
10300
+ return SafeEval.evalAst(this.ast, keyMap);
10301
+ }
10302
+ }
10303
+
10304
+ /* eslint-disable camelcase -- Convenient for escaping */
10305
+
10306
+
10307
+ /**
10308
+ * @typedef {null|boolean|number|string|object|GenericArray} JSONObject
9152
10309
  */
9153
10310
 
9154
10311
  /**
@@ -9165,7 +10322,6 @@ var hasOwnProp = Object.prototype.hasOwnProperty;
9165
10322
  * @param {AnyItem} item Array item to add (to end)
9166
10323
  * @returns {GenericArray} Copy of the original array
9167
10324
  */
9168
-
9169
10325
  function push(arr, item) {
9170
10326
  arr = arr.slice();
9171
10327
  arr.push(item);
@@ -9177,52 +10333,39 @@ function push(arr, item) {
9177
10333
  * @param {GenericArray} arr Array to copy and into which to unshift
9178
10334
  * @returns {GenericArray} Copy of the original array
9179
10335
  */
9180
-
9181
-
9182
10336
  function unshift(item, arr) {
9183
10337
  arr = arr.slice();
9184
10338
  arr.unshift(item);
9185
10339
  return arr;
9186
10340
  }
10341
+
9187
10342
  /**
9188
10343
  * Caught when JSONPath is used without `new` but rethrown if with `new`
9189
10344
  * @extends Error
9190
10345
  */
9191
-
9192
-
9193
- var NewError = /*#__PURE__*/function (_Error) {
9194
- _inherits(NewError, _Error);
9195
-
9196
- var _super = _createSuper(NewError);
9197
-
10346
+ class NewError extends Error {
9198
10347
  /**
9199
10348
  * @param {AnyResult} value The evaluated scalar value
9200
10349
  */
9201
- function NewError(value) {
9202
- var _this;
9203
-
9204
- _classCallCheck(this, NewError);
9205
-
9206
- _this = _super.call(this, 'JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)');
9207
- _this.avoidNew = true;
9208
- _this.value = value;
9209
- _this.name = 'NewError';
9210
- return _this;
10350
+ constructor(value) {
10351
+ super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)');
10352
+ this.avoidNew = true;
10353
+ this.value = value;
10354
+ this.name = 'NewError';
9211
10355
  }
10356
+ }
9212
10357
 
9213
- return _createClass(NewError);
9214
- }( /*#__PURE__*/_wrapNativeSuper(Error));
9215
10358
  /**
9216
- * @typedef {PlainObject} ReturnObject
10359
+ * @typedef {object} ReturnObject
9217
10360
  * @property {string} path
9218
10361
  * @property {JSONObject} value
9219
- * @property {PlainObject|GenericArray} parent
10362
+ * @property {object|GenericArray} parent
9220
10363
  * @property {string} parentProperty
9221
10364
  */
9222
10365
 
9223
10366
  /**
9224
10367
  * @callback JSONPathCallback
9225
- * @param {string|PlainObject} preferredOutput
10368
+ * @param {string|object} preferredOutput
9226
10369
  * @param {"value"|"property"} type
9227
10370
  * @param {ReturnObject} fullRetObj
9228
10371
  * @returns {void}
@@ -9232,23 +10375,42 @@ var NewError = /*#__PURE__*/function (_Error) {
9232
10375
  * @callback OtherTypeCallback
9233
10376
  * @param {JSONObject} val
9234
10377
  * @param {string} path
9235
- * @param {PlainObject|GenericArray} parent
10378
+ * @param {object|GenericArray} parent
9236
10379
  * @param {string} parentPropName
9237
10380
  * @returns {boolean}
9238
10381
  */
9239
10382
 
9240
- /* eslint-disable max-len -- Can make multiline type after https://github.com/syavorsky/comment-parser/issues/109 */
10383
+ /**
10384
+ * @typedef {any} ContextItem
10385
+ */
10386
+
10387
+ /**
10388
+ * @typedef {any} EvaluatedResult
10389
+ */
10390
+
10391
+ /**
10392
+ * @callback EvalCallback
10393
+ * @param {string} code
10394
+ * @param {ContextItem} context
10395
+ * @returns {EvaluatedResult}
10396
+ */
9241
10397
 
9242
10398
  /**
9243
- * @typedef {PlainObject} JSONPathOptions
10399
+ * @typedef {typeof SafeScript} EvalClass
10400
+ */
10401
+
10402
+ /**
10403
+ * @typedef {object} JSONPathOptions
9244
10404
  * @property {JSON} json
9245
10405
  * @property {string|string[]} path
9246
- * @property {"value"|"path"|"pointer"|"parent"|"parentProperty"|"all"} [resultType="value"]
10406
+ * @property {"value"|"path"|"pointer"|"parent"|"parentProperty"|
10407
+ * "all"} [resultType="value"]
9247
10408
  * @property {boolean} [flatten=false]
9248
10409
  * @property {boolean} [wrap=true]
9249
- * @property {PlainObject} [sandbox={}]
9250
- * @property {boolean} [preventEval=false]
9251
- * @property {PlainObject|GenericArray|null} [parent=null]
10410
+ * @property {object} [sandbox={}]
10411
+ * @property {EvalCallback|EvalClass|'safe'|'native'|
10412
+ * boolean} [eval = 'safe']
10413
+ * @property {object|GenericArray|null} [parent=null]
9252
10414
  * @property {string|null} [parentProperty=null]
9253
10415
  * @property {JSONPathCallback} [callback]
9254
10416
  * @property {OtherTypeCallback} [otherTypeCallback] Defaults to
@@ -9256,8 +10418,6 @@ var NewError = /*#__PURE__*/function (_Error) {
9256
10418
  * @property {boolean} [autostart=true]
9257
10419
  */
9258
10420
 
9259
- /* eslint-enable max-len -- Can make multiline type after https://github.com/syavorsky/comment-parser/issues/109 */
9260
-
9261
10421
  /**
9262
10422
  * @param {string|JSONPathOptions} opts If a string, will be treated as `expr`
9263
10423
  * @param {string} [expr] JSON path to evaluate
@@ -9273,10 +10433,8 @@ var NewError = /*#__PURE__*/function (_Error) {
9273
10433
  * @returns {JSONPath}
9274
10434
  * @class
9275
10435
  */
9276
-
9277
-
9278
10436
  function JSONPath(opts, expr, obj, callback, otherTypeCallback) {
9279
- // eslint-disable-next-line no-restricted-syntax
10437
+ // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class
9280
10438
  if (!(this instanceof JSONPath)) {
9281
10439
  try {
9282
10440
  return new JSONPath(opts, expr, obj, callback, otherTypeCallback);
@@ -9284,11 +10442,9 @@ function JSONPath(opts, expr, obj, callback, otherTypeCallback) {
9284
10442
  if (!e.avoidNew) {
9285
10443
  throw e;
9286
10444
  }
9287
-
9288
10445
  return e.value;
9289
10446
  }
9290
10447
  }
9291
-
9292
10448
  if (typeof opts === 'string') {
9293
10449
  otherTypeCallback = callback;
9294
10450
  callback = obj;
@@ -9296,249 +10452,215 @@ function JSONPath(opts, expr, obj, callback, otherTypeCallback) {
9296
10452
  expr = opts;
9297
10453
  opts = null;
9298
10454
  }
9299
-
9300
- var optObj = opts && _typeof(opts) === 'object';
10455
+ const optObj = opts && typeof opts === 'object';
9301
10456
  opts = opts || {};
9302
10457
  this.json = opts.json || obj;
9303
10458
  this.path = opts.path || expr;
9304
10459
  this.resultType = opts.resultType || 'value';
9305
10460
  this.flatten = opts.flatten || false;
9306
- this.wrap = hasOwnProp.call(opts, 'wrap') ? opts.wrap : true;
10461
+ this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true;
9307
10462
  this.sandbox = opts.sandbox || {};
9308
- this.preventEval = opts.preventEval || false;
10463
+ this.eval = opts.eval === undefined ? 'safe' : opts.eval;
10464
+ this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors;
9309
10465
  this.parent = opts.parent || null;
9310
10466
  this.parentProperty = opts.parentProperty || null;
9311
10467
  this.callback = opts.callback || callback || null;
9312
-
9313
10468
  this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () {
9314
10469
  throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.');
9315
10470
  };
9316
-
9317
10471
  if (opts.autostart !== false) {
9318
- var args = {
10472
+ const args = {
9319
10473
  path: optObj ? opts.path : expr
9320
10474
  };
9321
-
9322
10475
  if (!optObj) {
9323
10476
  args.json = obj;
9324
10477
  } else if ('json' in opts) {
9325
10478
  args.json = opts.json;
9326
10479
  }
9327
-
9328
- var ret = this.evaluate(args);
9329
-
9330
- if (!ret || _typeof(ret) !== 'object') {
10480
+ const ret = this.evaluate(args);
10481
+ if (!ret || typeof ret !== 'object') {
9331
10482
  throw new NewError(ret);
9332
10483
  }
9333
-
9334
10484
  return ret;
9335
10485
  }
9336
- } // PUBLIC METHODS
9337
-
10486
+ }
9338
10487
 
10488
+ // PUBLIC METHODS
9339
10489
  JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) {
9340
- var _this2 = this;
9341
-
9342
- var currParent = this.parent,
9343
- currParentProperty = this.parentProperty;
9344
- var flatten = this.flatten,
9345
- wrap = this.wrap;
10490
+ let currParent = this.parent,
10491
+ currParentProperty = this.parentProperty;
10492
+ let {
10493
+ flatten,
10494
+ wrap
10495
+ } = this;
9346
10496
  this.currResultType = this.resultType;
9347
- this.currPreventEval = this.preventEval;
10497
+ this.currEval = this.eval;
9348
10498
  this.currSandbox = this.sandbox;
9349
10499
  callback = callback || this.callback;
9350
10500
  this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback;
9351
10501
  json = json || this.json;
9352
10502
  expr = expr || this.path;
9353
-
9354
- if (expr && _typeof(expr) === 'object' && !Array.isArray(expr)) {
10503
+ if (expr && typeof expr === 'object' && !Array.isArray(expr)) {
9355
10504
  if (!expr.path && expr.path !== '') {
9356
10505
  throw new TypeError('You must supply a "path" property when providing an object ' + 'argument to JSONPath.evaluate().');
9357
10506
  }
9358
-
9359
- if (!hasOwnProp.call(expr, 'json')) {
10507
+ if (!Object.hasOwn(expr, 'json')) {
9360
10508
  throw new TypeError('You must supply a "json" property when providing an object ' + 'argument to JSONPath.evaluate().');
9361
10509
  }
9362
-
9363
- var _expr = expr;
9364
- json = _expr.json;
9365
- flatten = hasOwnProp.call(expr, 'flatten') ? expr.flatten : flatten;
9366
- this.currResultType = hasOwnProp.call(expr, 'resultType') ? expr.resultType : this.currResultType;
9367
- this.currSandbox = hasOwnProp.call(expr, 'sandbox') ? expr.sandbox : this.currSandbox;
9368
- wrap = hasOwnProp.call(expr, 'wrap') ? expr.wrap : wrap;
9369
- this.currPreventEval = hasOwnProp.call(expr, 'preventEval') ? expr.preventEval : this.currPreventEval;
9370
- callback = hasOwnProp.call(expr, 'callback') ? expr.callback : callback;
9371
- this.currOtherTypeCallback = hasOwnProp.call(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback;
9372
- currParent = hasOwnProp.call(expr, 'parent') ? expr.parent : currParent;
9373
- currParentProperty = hasOwnProp.call(expr, 'parentProperty') ? expr.parentProperty : currParentProperty;
10510
+ ({
10511
+ json
10512
+ } = expr);
10513
+ flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten;
10514
+ this.currResultType = Object.hasOwn(expr, 'resultType') ? expr.resultType : this.currResultType;
10515
+ this.currSandbox = Object.hasOwn(expr, 'sandbox') ? expr.sandbox : this.currSandbox;
10516
+ wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap;
10517
+ this.currEval = Object.hasOwn(expr, 'eval') ? expr.eval : this.currEval;
10518
+ callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback;
10519
+ this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback;
10520
+ currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent;
10521
+ currParentProperty = Object.hasOwn(expr, 'parentProperty') ? expr.parentProperty : currParentProperty;
9374
10522
  expr = expr.path;
9375
10523
  }
9376
-
9377
10524
  currParent = currParent || null;
9378
10525
  currParentProperty = currParentProperty || null;
9379
-
9380
10526
  if (Array.isArray(expr)) {
9381
10527
  expr = JSONPath.toPathString(expr);
9382
10528
  }
9383
-
9384
10529
  if (!expr && expr !== '' || !json) {
9385
10530
  return undefined;
9386
10531
  }
9387
-
9388
- var exprList = JSONPath.toPathArray(expr);
9389
-
10532
+ const exprList = JSONPath.toPathArray(expr);
9390
10533
  if (exprList[0] === '$' && exprList.length > 1) {
9391
10534
  exprList.shift();
9392
10535
  }
9393
-
9394
10536
  this._hasParentSelector = null;
9395
-
9396
- var result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) {
10537
+ const result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) {
9397
10538
  return ea && !ea.isParentSelector;
9398
10539
  });
9399
-
9400
10540
  if (!result.length) {
9401
10541
  return wrap ? [] : undefined;
9402
10542
  }
9403
-
9404
10543
  if (!wrap && result.length === 1 && !result[0].hasArrExpr) {
9405
10544
  return this._getPreferredOutput(result[0]);
9406
10545
  }
9407
-
9408
- return result.reduce(function (rslt, ea) {
9409
- var valOrPath = _this2._getPreferredOutput(ea);
9410
-
10546
+ return result.reduce((rslt, ea) => {
10547
+ const valOrPath = this._getPreferredOutput(ea);
9411
10548
  if (flatten && Array.isArray(valOrPath)) {
9412
10549
  rslt = rslt.concat(valOrPath);
9413
10550
  } else {
9414
10551
  rslt.push(valOrPath);
9415
10552
  }
9416
-
9417
10553
  return rslt;
9418
10554
  }, []);
9419
- }; // PRIVATE METHODS
10555
+ };
9420
10556
 
10557
+ // PRIVATE METHODS
9421
10558
 
9422
10559
  JSONPath.prototype._getPreferredOutput = function (ea) {
9423
- var resultType = this.currResultType;
9424
-
10560
+ const resultType = this.currResultType;
9425
10561
  switch (resultType) {
9426
10562
  case 'all':
9427
10563
  {
9428
- var path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path);
10564
+ const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path);
9429
10565
  ea.pointer = JSONPath.toPointer(path);
9430
10566
  ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path);
9431
10567
  return ea;
9432
10568
  }
9433
-
9434
10569
  case 'value':
9435
10570
  case 'parent':
9436
10571
  case 'parentProperty':
9437
10572
  return ea[resultType];
9438
-
9439
10573
  case 'path':
9440
10574
  return JSONPath.toPathString(ea[resultType]);
9441
-
9442
10575
  case 'pointer':
9443
10576
  return JSONPath.toPointer(ea.path);
9444
-
9445
10577
  default:
9446
10578
  throw new TypeError('Unknown result type');
9447
10579
  }
9448
10580
  };
9449
-
9450
10581
  JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) {
9451
10582
  if (callback) {
9452
- var preferredOutput = this._getPreferredOutput(fullRetObj);
9453
-
9454
- fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); // eslint-disable-next-line n/callback-return
9455
-
10583
+ const preferredOutput = this._getPreferredOutput(fullRetObj);
10584
+ fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path);
10585
+ // eslint-disable-next-line n/callback-return -- No need to return
9456
10586
  callback(preferredOutput, type, fullRetObj);
9457
10587
  }
9458
10588
  };
10589
+
9459
10590
  /**
9460
10591
  *
9461
10592
  * @param {string} expr
9462
10593
  * @param {JSONObject} val
9463
10594
  * @param {string} path
9464
- * @param {PlainObject|GenericArray} parent
10595
+ * @param {object|GenericArray} parent
9465
10596
  * @param {string} parentPropName
9466
10597
  * @param {JSONPathCallback} callback
9467
10598
  * @param {boolean} hasArrExpr
9468
10599
  * @param {boolean} literalPriority
9469
10600
  * @returns {ReturnObject|ReturnObject[]}
9470
10601
  */
9471
-
9472
-
9473
10602
  JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) {
9474
- var _this3 = this;
9475
-
9476
10603
  // No expr to follow? return path and value as the result of
9477
10604
  // this trace branch
9478
- var retObj;
9479
-
10605
+ let retObj;
9480
10606
  if (!expr.length) {
9481
10607
  retObj = {
9482
- path: path,
10608
+ path,
9483
10609
  value: val,
9484
- parent: parent,
10610
+ parent,
9485
10611
  parentProperty: parentPropName,
9486
- hasArrExpr: hasArrExpr
10612
+ hasArrExpr
9487
10613
  };
9488
-
9489
10614
  this._handleCallback(retObj, callback, 'value');
9490
-
9491
10615
  return retObj;
9492
10616
  }
10617
+ const loc = expr[0],
10618
+ x = expr.slice(1);
9493
10619
 
9494
- var loc = expr[0],
9495
- x = expr.slice(1); // We need to gather the return value of recursive trace calls in order to
10620
+ // We need to gather the return value of recursive trace calls in order to
9496
10621
  // do the parent sel computation.
9497
-
9498
- var ret = [];
10622
+ const ret = [];
9499
10623
  /**
9500
10624
  *
9501
10625
  * @param {ReturnObject|ReturnObject[]} elems
9502
10626
  * @returns {void}
9503
10627
  */
9504
-
9505
10628
  function addRet(elems) {
9506
10629
  if (Array.isArray(elems)) {
9507
10630
  // This was causing excessive stack size in Node (with or
9508
10631
  // without Babel) against our performance test:
9509
10632
  // `ret.push(...elems);`
9510
- elems.forEach(function (t) {
10633
+ elems.forEach(t => {
9511
10634
  ret.push(t);
9512
10635
  });
9513
10636
  } else {
9514
10637
  ret.push(elems);
9515
10638
  }
9516
10639
  }
9517
-
9518
- if ((typeof loc !== 'string' || literalPriority) && val && hasOwnProp.call(val, loc)) {
10640
+ if ((typeof loc !== 'string' || literalPriority) && val && Object.hasOwn(val, loc)) {
9519
10641
  // simple case--directly follow property
9520
- addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr)); // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if`
10642
+ addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr));
10643
+ // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if`
9521
10644
  } else if (loc === '*') {
9522
10645
  // all child properties
9523
- this._walk(val, function (m) {
9524
- addRet(_this3._trace(x, val[m], push(path, m), val, m, callback, true, true));
10646
+ this._walk(val, m => {
10647
+ addRet(this._trace(x, val[m], push(path, m), val, m, callback, true, true));
9525
10648
  });
9526
10649
  } else if (loc === '..') {
9527
10650
  // all descendent parent properties
9528
10651
  // Check remaining expression with val's immediate children
9529
10652
  addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr));
9530
-
9531
- this._walk(val, function (m) {
10653
+ this._walk(val, m => {
9532
10654
  // We don't join m and x here because we only want parents,
9533
10655
  // not scalar values
9534
- if (_typeof(val[m]) === 'object') {
10656
+ if (typeof val[m] === 'object') {
9535
10657
  // Keep going with recursive descent on val's
9536
10658
  // object children
9537
- addRet(_this3._trace(expr.slice(), val[m], push(path, m), val, m, callback, true));
10659
+ addRet(this._trace(expr.slice(), val[m], push(path, m), val, m, callback, true));
9538
10660
  }
9539
- }); // The parent sel computation is handled in the frame above using the
10661
+ });
10662
+ // The parent sel computation is handled in the frame above using the
9540
10663
  // ancestor object of val
9541
-
9542
10664
  } else if (loc === '^') {
9543
10665
  // This is not a final endpoint, so we do not invoke the callback here
9544
10666
  this._hasParentSelector = true;
@@ -9552,172 +10674,146 @@ JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, c
9552
10674
  retObj = {
9553
10675
  path: push(path, loc),
9554
10676
  value: parentPropName,
9555
- parent: parent,
10677
+ parent,
9556
10678
  parentProperty: null
9557
10679
  };
9558
-
9559
10680
  this._handleCallback(retObj, callback, 'property');
9560
-
9561
10681
  return retObj;
9562
10682
  } else if (loc === '$') {
9563
10683
  // root only
9564
10684
  addRet(this._trace(x, val, path, null, null, callback, hasArrExpr));
9565
- } else if (/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(loc)) {
10685
+ } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) {
9566
10686
  // [start:end:step] Python slice syntax
9567
10687
  addRet(this._slice(loc, x, val, path, parent, parentPropName, callback));
9568
10688
  } else if (loc.indexOf('?(') === 0) {
9569
10689
  // [?(expr)] (filtering)
9570
- if (this.currPreventEval) {
10690
+ if (this.currEval === false) {
9571
10691
  throw new Error('Eval [?(expr)] prevented in JSONPath expression.');
9572
10692
  }
9573
-
9574
- var safeLoc = loc.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/, '$1');
9575
-
9576
- this._walk(val, function (m) {
9577
- if (_this3._eval(safeLoc, val[m], m, path, parent, parentPropName)) {
9578
- addRet(_this3._trace(x, val[m], push(path, m), val, m, callback, true));
9579
- }
9580
- });
10693
+ const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1');
10694
+ // check for a nested filter expression
10695
+ const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc);
10696
+ if (nested) {
10697
+ // find if there are matches in the nested expression
10698
+ // add them to the result set if there is at least one match
10699
+ this._walk(val, m => {
10700
+ const npath = [nested[2]];
10701
+ const nvalue = nested[1] ? val[m][nested[1]] : val[m];
10702
+ const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true);
10703
+ if (filterResults.length > 0) {
10704
+ addRet(this._trace(x, val[m], push(path, m), val, m, callback, true));
10705
+ }
10706
+ });
10707
+ } else {
10708
+ this._walk(val, m => {
10709
+ if (this._eval(safeLoc, val[m], m, path, parent, parentPropName)) {
10710
+ addRet(this._trace(x, val[m], push(path, m), val, m, callback, true));
10711
+ }
10712
+ });
10713
+ }
9581
10714
  } else if (loc[0] === '(') {
9582
10715
  // [(expr)] (dynamic property/index)
9583
- if (this.currPreventEval) {
10716
+ if (this.currEval === false) {
9584
10717
  throw new Error('Eval [(expr)] prevented in JSONPath expression.');
9585
- } // As this will resolve to a property name (but we don't know it
10718
+ }
10719
+ // As this will resolve to a property name (but we don't know it
9586
10720
  // yet), property and parent information is relative to the
9587
10721
  // parent of the property to which this expression will resolve
9588
-
9589
-
9590
- addRet(this._trace(unshift(this._eval(loc, val, path[path.length - 1], path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback, hasArrExpr));
10722
+ addRet(this._trace(unshift(this._eval(loc, val, path.at(-1), path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback, hasArrExpr));
9591
10723
  } else if (loc[0] === '@') {
9592
10724
  // value type: @boolean(), etc.
9593
- var addType = false;
9594
- var valueType = loc.slice(1, -2);
9595
-
10725
+ let addType = false;
10726
+ const valueType = loc.slice(1, -2);
9596
10727
  switch (valueType) {
9597
10728
  case 'scalar':
9598
- if (!val || !['object', 'function'].includes(_typeof(val))) {
10729
+ if (!val || !['object', 'function'].includes(typeof val)) {
9599
10730
  addType = true;
9600
10731
  }
9601
-
9602
10732
  break;
9603
-
9604
10733
  case 'boolean':
9605
10734
  case 'string':
9606
10735
  case 'undefined':
9607
10736
  case 'function':
9608
- // eslint-disable-next-line valid-typeof
9609
- if (_typeof(val) === valueType) {
10737
+ if (typeof val === valueType) {
9610
10738
  addType = true;
9611
10739
  }
9612
-
9613
10740
  break;
9614
-
9615
10741
  case 'integer':
9616
10742
  if (Number.isFinite(val) && !(val % 1)) {
9617
10743
  addType = true;
9618
10744
  }
9619
-
9620
10745
  break;
9621
-
9622
10746
  case 'number':
9623
10747
  if (Number.isFinite(val)) {
9624
10748
  addType = true;
9625
10749
  }
9626
-
9627
10750
  break;
9628
-
9629
10751
  case 'nonFinite':
9630
10752
  if (typeof val === 'number' && !Number.isFinite(val)) {
9631
10753
  addType = true;
9632
10754
  }
9633
-
9634
10755
  break;
9635
-
9636
10756
  case 'object':
9637
- // eslint-disable-next-line valid-typeof
9638
- if (val && _typeof(val) === valueType) {
10757
+ if (val && typeof val === valueType) {
9639
10758
  addType = true;
9640
10759
  }
9641
-
9642
10760
  break;
9643
-
9644
10761
  case 'array':
9645
10762
  if (Array.isArray(val)) {
9646
10763
  addType = true;
9647
10764
  }
9648
-
9649
10765
  break;
9650
-
9651
10766
  case 'other':
9652
10767
  addType = this.currOtherTypeCallback(val, path, parent, parentPropName);
9653
10768
  break;
9654
-
9655
10769
  case 'null':
9656
10770
  if (val === null) {
9657
10771
  addType = true;
9658
10772
  }
9659
-
9660
10773
  break;
9661
-
9662
10774
  /* c8 ignore next 2 */
9663
-
9664
10775
  default:
9665
10776
  throw new TypeError('Unknown value type ' + valueType);
9666
10777
  }
9667
-
9668
10778
  if (addType) {
9669
10779
  retObj = {
9670
- path: path,
10780
+ path,
9671
10781
  value: val,
9672
- parent: parent,
10782
+ parent,
9673
10783
  parentProperty: parentPropName
9674
10784
  };
9675
-
9676
10785
  this._handleCallback(retObj, callback, 'value');
9677
-
9678
10786
  return retObj;
9679
- } // `-escaped property
9680
-
9681
- } else if (loc[0] === '`' && val && hasOwnProp.call(val, loc.slice(1))) {
9682
- var locProp = loc.slice(1);
10787
+ }
10788
+ // `-escaped property
10789
+ } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) {
10790
+ const locProp = loc.slice(1);
9683
10791
  addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true));
9684
10792
  } else if (loc.includes(',')) {
9685
10793
  // [name1,name2,...]
9686
- var parts = loc.split(',');
9687
-
9688
- var _iterator = _createForOfIteratorHelper(parts),
9689
- _step;
9690
-
9691
- try {
9692
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
9693
- var part = _step.value;
9694
- addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true));
9695
- } // simple case--directly follow property
9696
-
9697
- } catch (err) {
9698
- _iterator.e(err);
9699
- } finally {
9700
- _iterator.f();
10794
+ const parts = loc.split(',');
10795
+ for (const part of parts) {
10796
+ addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true));
9701
10797
  }
9702
- } else if (!literalPriority && val && hasOwnProp.call(val, loc)) {
10798
+ // simple case--directly follow property
10799
+ } else if (!literalPriority && val && Object.hasOwn(val, loc)) {
9703
10800
  addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr, true));
9704
- } // We check the resulting values for parent selections. For parent
10801
+ }
10802
+
10803
+ // We check the resulting values for parent selections. For parent
9705
10804
  // selections we discard the value object and continue the trace with the
9706
10805
  // current val object
9707
-
9708
-
9709
10806
  if (this._hasParentSelector) {
9710
- for (var t = 0; t < ret.length; t++) {
9711
- var rett = ret[t];
9712
-
10807
+ for (let t = 0; t < ret.length; t++) {
10808
+ const rett = ret[t];
9713
10809
  if (rett && rett.isParentSelector) {
9714
- var tmp = this._trace(rett.expr, val, rett.path, parent, parentPropName, callback, hasArrExpr);
9715
-
10810
+ const tmp = this._trace(rett.expr, val, rett.path, parent, parentPropName, callback, hasArrExpr);
9716
10811
  if (Array.isArray(tmp)) {
9717
10812
  ret[t] = tmp[0];
9718
- var tl = tmp.length;
9719
-
9720
- for (var tt = 1; tt < tl; tt++) {
10813
+ const tl = tmp.length;
10814
+ for (let tt = 1; tt < tl; tt++) {
10815
+ // eslint-disable-next-line @stylistic/max-len -- Long
10816
+ // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient
9721
10817
  t++;
9722
10818
  ret.splice(t, 0, tmp[tt]);
9723
10819
  }
@@ -9727,164 +10823,173 @@ JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, c
9727
10823
  }
9728
10824
  }
9729
10825
  }
9730
-
9731
10826
  return ret;
9732
10827
  };
9733
-
9734
10828
  JSONPath.prototype._walk = function (val, f) {
9735
10829
  if (Array.isArray(val)) {
9736
- var n = val.length;
9737
-
9738
- for (var i = 0; i < n; i++) {
10830
+ const n = val.length;
10831
+ for (let i = 0; i < n; i++) {
9739
10832
  f(i);
9740
10833
  }
9741
- } else if (val && _typeof(val) === 'object') {
9742
- Object.keys(val).forEach(function (m) {
10834
+ } else if (val && typeof val === 'object') {
10835
+ Object.keys(val).forEach(m => {
9743
10836
  f(m);
9744
10837
  });
9745
10838
  }
9746
10839
  };
9747
-
9748
10840
  JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) {
9749
10841
  if (!Array.isArray(val)) {
9750
10842
  return undefined;
9751
10843
  }
9752
-
9753
- var len = val.length,
9754
- parts = loc.split(':'),
9755
- step = parts[2] && Number.parseInt(parts[2]) || 1;
9756
- var start = parts[0] && Number.parseInt(parts[0]) || 0,
9757
- end = parts[1] && Number.parseInt(parts[1]) || len;
10844
+ const len = val.length,
10845
+ parts = loc.split(':'),
10846
+ step = parts[2] && Number.parseInt(parts[2]) || 1;
10847
+ let start = parts[0] && Number.parseInt(parts[0]) || 0,
10848
+ end = parts[1] && Number.parseInt(parts[1]) || len;
9758
10849
  start = start < 0 ? Math.max(0, start + len) : Math.min(len, start);
9759
10850
  end = end < 0 ? Math.max(0, end + len) : Math.min(len, end);
9760
- var ret = [];
9761
-
9762
- for (var i = start; i < end; i += step) {
9763
- var tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); // Should only be possible to be an array here since first part of
10851
+ const ret = [];
10852
+ for (let i = start; i < end; i += step) {
10853
+ const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true);
10854
+ // Should only be possible to be an array here since first part of
9764
10855
  // ``unshift(i, expr)` passed in above would not be empty, nor `~`,
9765
10856
  // nor begin with `@` (as could return objects)
9766
10857
  // This was causing excessive stack size in Node (with or
9767
10858
  // without Babel) against our performance test: `ret.push(...tmp);`
9768
-
9769
-
9770
- tmp.forEach(function (t) {
10859
+ tmp.forEach(t => {
9771
10860
  ret.push(t);
9772
10861
  });
9773
10862
  }
9774
-
9775
10863
  return ret;
9776
10864
  };
9777
-
9778
10865
  JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) {
9779
10866
  this.currSandbox._$_parentProperty = parentPropName;
9780
10867
  this.currSandbox._$_parent = parent;
9781
10868
  this.currSandbox._$_property = _vname;
9782
10869
  this.currSandbox._$_root = this.json;
9783
10870
  this.currSandbox._$_v = _v;
9784
- var containsPath = code.includes('@path');
9785
-
10871
+ const containsPath = code.includes('@path');
9786
10872
  if (containsPath) {
9787
10873
  this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname]));
9788
10874
  }
9789
-
9790
- var scriptCacheKey = 'script:' + code;
9791
-
10875
+ const scriptCacheKey = this.currEval + 'Script:' + code;
9792
10876
  if (!JSONPath.cache[scriptCacheKey]) {
9793
- var script = code.replace(/@parentProperty/g, '_$_parentProperty').replace(/@parent/g, '_$_parent').replace(/@property/g, '_$_property').replace(/@root/g, '_$_root').replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g, '_$_v$1');
9794
-
10877
+ let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1');
9795
10878
  if (containsPath) {
9796
- script = script.replace(/@path/g, '_$_path');
10879
+ script = script.replaceAll('@path', '_$_path');
10880
+ }
10881
+ if (this.currEval === 'safe' || this.currEval === true || this.currEval === undefined) {
10882
+ JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script);
10883
+ } else if (this.currEval === 'native') {
10884
+ JSONPath.cache[scriptCacheKey] = new this.vm.Script(script);
10885
+ } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) {
10886
+ const CurrEval = this.currEval;
10887
+ JSONPath.cache[scriptCacheKey] = new CurrEval(script);
10888
+ } else if (typeof this.currEval === 'function') {
10889
+ JSONPath.cache[scriptCacheKey] = {
10890
+ runInNewContext: context => this.currEval(script, context)
10891
+ };
10892
+ } else {
10893
+ throw new TypeError(`Unknown "eval" property "${this.currEval}"`);
9797
10894
  }
9798
-
9799
- JSONPath.cache[scriptCacheKey] = new this.vm.Script(script);
9800
10895
  }
9801
-
9802
10896
  try {
9803
10897
  return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox);
9804
10898
  } catch (e) {
10899
+ if (this.ignoreEvalErrors) {
10900
+ return false;
10901
+ }
9805
10902
  throw new Error('jsonPath: ' + e.message + ': ' + code);
9806
10903
  }
9807
- }; // PUBLIC CLASS PROPERTIES AND METHODS
9808
- // Could store the cache object itself
10904
+ };
9809
10905
 
10906
+ // PUBLIC CLASS PROPERTIES AND METHODS
9810
10907
 
10908
+ // Could store the cache object itself
9811
10909
  JSONPath.cache = {};
10910
+
9812
10911
  /**
9813
10912
  * @param {string[]} pathArr Array to convert
9814
10913
  * @returns {string} The path string
9815
10914
  */
9816
-
9817
10915
  JSONPath.toPathString = function (pathArr) {
9818
- var x = pathArr,
9819
- n = x.length;
9820
- var p = '$';
9821
-
9822
- for (var i = 1; i < n; i++) {
9823
- if (!/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(x[i])) {
9824
- p += /^[\*0-9]+$/.test(x[i]) ? '[' + x[i] + ']' : "['" + x[i] + "']";
10916
+ const x = pathArr,
10917
+ n = x.length;
10918
+ let p = '$';
10919
+ for (let i = 1; i < n; i++) {
10920
+ if (!/^(~|\^|@.*?\(\))$/u.test(x[i])) {
10921
+ p += /^[0-9*]+$/u.test(x[i]) ? '[' + x[i] + ']' : "['" + x[i] + "']";
9825
10922
  }
9826
10923
  }
9827
-
9828
10924
  return p;
9829
10925
  };
10926
+
9830
10927
  /**
9831
10928
  * @param {string} pointer JSON Path
9832
10929
  * @returns {string} JSON Pointer
9833
10930
  */
9834
-
9835
-
9836
10931
  JSONPath.toPointer = function (pointer) {
9837
- var x = pointer,
9838
- n = x.length;
9839
- var p = '';
9840
-
9841
- for (var i = 1; i < n; i++) {
9842
- if (!/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(x[i])) {
9843
- p += '/' + x[i].toString().replace(/~/g, '~0').replace(/\//g, '~1');
10932
+ const x = pointer,
10933
+ n = x.length;
10934
+ let p = '';
10935
+ for (let i = 1; i < n; i++) {
10936
+ if (!/^(~|\^|@.*?\(\))$/u.test(x[i])) {
10937
+ p += '/' + x[i].toString().replaceAll('~', '~0').replaceAll('/', '~1');
9844
10938
  }
9845
10939
  }
9846
-
9847
10940
  return p;
9848
10941
  };
10942
+
9849
10943
  /**
9850
10944
  * @param {string} expr Expression to convert
9851
10945
  * @returns {string[]}
9852
10946
  */
9853
-
9854
-
9855
10947
  JSONPath.toPathArray = function (expr) {
9856
- var cache = JSONPath.cache;
9857
-
10948
+ const {
10949
+ cache
10950
+ } = JSONPath;
9858
10951
  if (cache[expr]) {
9859
10952
  return cache[expr].concat();
9860
10953
  }
9861
-
9862
- var subx = [];
9863
- var normalized = expr // Properties
9864
- .replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g, ';$&;') // Parenthetical evaluations (filtering and otherwise), directly
10954
+ const subx = [];
10955
+ const normalized = expr
10956
+ // Properties
10957
+ .replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ';$&;')
10958
+ // Parenthetical evaluations (filtering and otherwise), directly
9865
10959
  // within brackets or single quotes
9866
- .replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g, function ($0, $1) {
10960
+ .replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function ($0, $1) {
9867
10961
  return '[#' + (subx.push($1) - 1) + ']';
9868
- }) // Escape periods and tildes within properties
9869
- .replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g, function ($0, prop) {
9870
- return "['" + prop.replace(/\./g, '%@%').replace(/~/g, '%%@@%%') + "']";
9871
- }) // Properties operator
9872
- .replace(/~/g, ';~;') // Split by property boundaries
9873
- .replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g, ';') // Reinsert periods within properties
9874
- .replace(/%@%/g, '.') // Reinsert tildes within properties
9875
- .replace(/%%@@%%/g, '~') // Parent
9876
- .replace(/(?:;)?(\^+)(?:;)?/g, function ($0, ups) {
10962
+ })
10963
+ // Escape periods and tildes within properties
10964
+ .replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function ($0, prop) {
10965
+ return "['" + prop.replaceAll('.', '%@%').replaceAll('~', '%%@@%%') + "']";
10966
+ })
10967
+ // Properties operator
10968
+ .replaceAll('~', ';~;')
10969
+ // Split by property boundaries
10970
+ .replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ';')
10971
+ // Reinsert periods within properties
10972
+ .replaceAll('%@%', '.')
10973
+ // Reinsert tildes within properties
10974
+ .replaceAll('%%@@%%', '~')
10975
+ // Parent
10976
+ .replaceAll(/(?:;)?(\^+)(?:;)?/gu, function ($0, ups) {
9877
10977
  return ';' + ups.split('').join(';') + ';';
9878
- }) // Descendents
9879
- .replace(/;;;|;;/g, ';..;') // Remove trailing
9880
- .replace(/;$|'?\]|'$/g, '');
9881
- var exprList = normalized.split(';').map(function (exp) {
9882
- var match = exp.match(/#([0-9]+)/);
10978
+ })
10979
+ // Descendents
10980
+ .replaceAll(/;;;|;;/gu, ';..;')
10981
+ // Remove trailing
10982
+ .replaceAll(/;$|'?\]|'$/gu, '');
10983
+ const exprList = normalized.split(';').map(function (exp) {
10984
+ const match = exp.match(/#(\d+)/u);
9883
10985
  return !match || !match[1] ? exp : subx[match[1]];
9884
10986
  });
9885
10987
  cache[expr] = exprList;
9886
10988
  return cache[expr].concat();
9887
10989
  };
10990
+ JSONPath.prototype.safeVm = {
10991
+ Script: SafeScript
10992
+ };
9888
10993
 
9889
10994
  /**
9890
10995
  * @typedef {any} ContextItem
@@ -9908,83 +11013,73 @@ JSONPath.toPathArray = function (expr) {
9908
11013
  * will move item if evaluates to `true`
9909
11014
  * @returns {void}
9910
11015
  */
9911
-
9912
- var moveToAnotherArray = function moveToAnotherArray(source, target, conditionCb) {
9913
- var il = source.length;
9914
-
9915
- for (var i = 0; i < il; i++) {
9916
- var item = source[i];
9917
-
11016
+ const moveToAnotherArray = function (source, target, conditionCb) {
11017
+ const il = source.length;
11018
+ for (let i = 0; i < il; i++) {
11019
+ const item = source[i];
9918
11020
  if (conditionCb(item)) {
11021
+ // eslint-disable-next-line @stylistic/max-len -- Long
11022
+ // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient
9919
11023
  target.push(source.splice(i--, 1)[0]);
9920
11024
  }
9921
11025
  }
9922
11026
  };
11027
+
9923
11028
  /**
9924
11029
  * In-browser replacement for NodeJS' VM.Script.
9925
11030
  */
9926
-
9927
-
9928
- var Script = /*#__PURE__*/function () {
11031
+ class Script {
9929
11032
  /**
9930
11033
  * @param {string} expr Expression to evaluate
9931
11034
  */
9932
- function Script(expr) {
9933
- _classCallCheck(this, Script);
9934
-
11035
+ constructor(expr) {
9935
11036
  this.code = expr;
9936
11037
  }
11038
+
9937
11039
  /**
9938
- * @param {PlainObject} context Object whose items will be added
11040
+ * @param {object} context Object whose items will be added
9939
11041
  * to evaluation
9940
11042
  * @returns {EvaluatedResult} Result of evaluated code
9941
11043
  */
11044
+ runInNewContext(context) {
11045
+ let expr = this.code;
11046
+ const keys = Object.keys(context);
11047
+ const funcs = [];
11048
+ moveToAnotherArray(keys, funcs, key => {
11049
+ return typeof context[key] === 'function';
11050
+ });
11051
+ const values = keys.map(vr => {
11052
+ return context[vr];
11053
+ });
11054
+ const funcString = funcs.reduce((s, func) => {
11055
+ let fString = context[func].toString();
11056
+ if (!/function/u.test(fString)) {
11057
+ fString = 'function ' + fString;
11058
+ }
11059
+ return 'var ' + func + '=' + fString + ';' + s;
11060
+ }, '');
11061
+ expr = funcString + expr;
9942
11062
 
9943
-
9944
- _createClass(Script, [{
9945
- key: "runInNewContext",
9946
- value: function runInNewContext(context) {
9947
- var expr = this.code;
9948
- var keys = Object.keys(context);
9949
- var funcs = [];
9950
- moveToAnotherArray(keys, funcs, function (key) {
9951
- return typeof context[key] === 'function';
9952
- });
9953
- var values = keys.map(function (vr, i) {
9954
- return context[vr];
9955
- });
9956
- var funcString = funcs.reduce(function (s, func) {
9957
- var fString = context[func].toString();
9958
-
9959
- if (!/function/.test(fString)) {
9960
- fString = 'function ' + fString;
9961
- }
9962
-
9963
- return 'var ' + func + '=' + fString + ';' + s;
9964
- }, '');
9965
- expr = funcString + expr; // Mitigate http://perfectionkills.com/global-eval-what-are-the-options/#new_function
9966
-
9967
- if (!/(["'])use strict\1/.test(expr) && !keys.includes('arguments')) {
9968
- expr = 'var arguments = undefined;' + expr;
9969
- } // Remove last semi so `return` will be inserted before
9970
- // the previous one instead, allowing for the return
9971
- // of a bare ending expression
9972
-
9973
-
9974
- expr = expr.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/, ''); // Insert `return`
9975
-
9976
- var lastStatementEnd = expr.lastIndexOf(';');
9977
- var code = lastStatementEnd > -1 ? expr.slice(0, lastStatementEnd + 1) + ' return ' + expr.slice(lastStatementEnd + 1) : ' return ' + expr; // eslint-disable-next-line no-new-func
9978
-
9979
- return _construct(Function, keys.concat([code])).apply(void 0, _toConsumableArray(values));
11063
+ // Mitigate http://perfectionkills.com/global-eval-what-are-the-options/#new_function
11064
+ if (!/(['"])use strict\1/u.test(expr) && !keys.includes('arguments')) {
11065
+ expr = 'var arguments = undefined;' + expr;
9980
11066
  }
9981
- }]);
9982
11067
 
9983
- return Script;
9984
- }();
11068
+ // Remove last semi so `return` will be inserted before
11069
+ // the previous one instead, allowing for the return
11070
+ // of a bare ending expression
11071
+ expr = expr.replace(/;\s*$/u, '');
11072
+
11073
+ // Insert `return`
11074
+ const lastStatementEnd = expr.lastIndexOf(';');
11075
+ const code = lastStatementEnd !== -1 ? expr.slice(0, lastStatementEnd + 1) + ' return ' + expr.slice(lastStatementEnd + 1) : ' return ' + expr;
9985
11076
 
11077
+ // eslint-disable-next-line no-new-func -- User's choice
11078
+ return new Function(...keys, code)(...values);
11079
+ }
11080
+ }
9986
11081
  JSONPath.prototype.vm = {
9987
- Script: Script
11082
+ Script
9988
11083
  };
9989
11084
 
9990
11085
 
@@ -14025,7 +15120,7 @@ var type = /*#__PURE__*/(0,_internal_curry1_js__WEBPACK_IMPORTED_MODULE_0__["def
14025
15120
 
14026
15121
  /***/ }),
14027
15122
 
14028
- /***/ 7951:
15123
+ /***/ 331:
14029
15124
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14030
15125
 
14031
15126
  "use strict";
@@ -14039,7 +15134,7 @@ __webpack_require__.r(__webpack_exports__);
14039
15134
  /* harmony export */ mergeAll: () => (/* binding */ mergeAll),
14040
15135
  /* harmony export */ visit: () => (/* binding */ visit)
14041
15136
  /* harmony export */ });
14042
- /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2449);
15137
+ /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4641);
14043
15138
 
14044
15139
 
14045
15140
  /**
@@ -14048,8 +15143,11 @@ __webpack_require__.r(__webpack_exports__);
14048
15143
  * SPDX-License-Identifier: MIT
14049
15144
  */
14050
15145
 
14051
- // getVisitFn :: (Visitor, String, Boolean) -> Function
15146
+ /**
15147
+ * @public
15148
+ */
14052
15149
  const getVisitFn = (visitor, type, isLeaving) => {
15150
+ // @ts-ignore
14053
15151
  const typeVisitor = visitor[type];
14054
15152
  if (typeVisitor != null) {
14055
15153
  if (!isLeaving && typeof typeVisitor === 'function') {
@@ -14068,6 +15166,7 @@ const getVisitFn = (visitor, type, isLeaving) => {
14068
15166
  // { enter() {}, leave() {} }
14069
15167
  return specificVisitor;
14070
15168
  }
15169
+ // @ts-ignore
14071
15170
  const specificTypeVisitor = specificVisitor[type];
14072
15171
  if (typeof specificTypeVisitor === 'function') {
14073
15172
  // { enter: { Type() {} }, leave: { Type() {} } }
@@ -14077,15 +15176,25 @@ const getVisitFn = (visitor, type, isLeaving) => {
14077
15176
  }
14078
15177
  return null;
14079
15178
  };
15179
+
15180
+ /**
15181
+ * @public
15182
+ */
14080
15183
  const BREAK = {};
14081
15184
 
14082
- // getNodeType :: Node -> String
15185
+ /**
15186
+ * @public
15187
+ */
14083
15188
  const getNodeType = node => node === null || node === void 0 ? void 0 : node.type;
14084
15189
 
14085
- // isNode :: Node -> Boolean
15190
+ /**
15191
+ * @public
15192
+ */
14086
15193
  const isNode = node => typeof getNodeType(node) === 'string';
14087
15194
 
14088
- // cloneNode :: a -> a
15195
+ /**
15196
+ * @public
15197
+ */
14089
15198
  const cloneNode = node => Object.create(Object.getPrototypeOf(node), Object.getOwnPropertyDescriptors(node));
14090
15199
 
14091
15200
  /**
@@ -14094,8 +15203,16 @@ const cloneNode = node => Object.create(Object.getPrototypeOf(node), Object.getO
14094
15203
  *
14095
15204
  * If a prior visitor edits a node, no following visitors will see that node.
14096
15205
  * `exposeEdits=true` can be used to expose the edited node from the previous visitors.
15206
+ * @public
15207
+ */
15208
+
15209
+ /**
15210
+ * @public
14097
15211
  */
14098
15212
 
15213
+ /**
15214
+ * @public
15215
+ */
14099
15216
  const mergeAll = (visitors, {
14100
15217
  visitFnGetter = getVisitFn,
14101
15218
  nodeTypeGetter = getNodeType,
@@ -14277,9 +15394,11 @@ mergeAll[Symbol.for('nodejs.util.promisify.custom')] = mergeAllAsync;
14277
15394
  * a new version of the AST with the changes applied will be returned from the
14278
15395
  * visit function.
14279
15396
  *
15397
+ * @example
15398
+ * ```
14280
15399
  * const editedAST = visit(ast, {
14281
15400
  * enter(node, key, parent, path, ancestors) {
14282
- * // @return
15401
+ * // return
14283
15402
  * // undefined: no action
14284
15403
  * // false: skip visiting this node
14285
15404
  * // BREAK: stop visiting altogether
@@ -14287,7 +15406,7 @@ mergeAll[Symbol.for('nodejs.util.promisify.custom')] = mergeAllAsync;
14287
15406
  * // any value: replace this node with the returned value
14288
15407
  * },
14289
15408
  * leave(node, key, parent, path, ancestors) {
14290
- * // @return
15409
+ * // return
14291
15410
  * // undefined: no action
14292
15411
  * // false: no action
14293
15412
  * // BREAK: stop visiting altogether
@@ -14295,23 +15414,23 @@ mergeAll[Symbol.for('nodejs.util.promisify.custom')] = mergeAllAsync;
14295
15414
  * // any value: replace this node with the returned value
14296
15415
  * }
14297
15416
  * });
14298
- *
15417
+ *```
14299
15418
  * Alternatively to providing enter() and leave() functions, a visitor can
14300
15419
  * instead provide functions named the same as the kinds of AST nodes, or
14301
15420
  * enter/leave visitors at a named key, leading to four permutations of
14302
15421
  * visitor API:
14303
15422
  *
14304
15423
  * 1) Named visitors triggered when entering a node a specific kind.
14305
- *
15424
+ * ```
14306
15425
  * visit(ast, {
14307
15426
  * Kind(node) {
14308
15427
  * // enter the "Kind" node
14309
15428
  * }
14310
15429
  * })
14311
- *
15430
+ * ```
14312
15431
  * 2) Named visitors that trigger upon entering and leaving a node of
14313
15432
  * a specific kind.
14314
- *
15433
+ * ```
14315
15434
  * visit(ast, {
14316
15435
  * Kind: {
14317
15436
  * enter(node) {
@@ -14322,9 +15441,9 @@ mergeAll[Symbol.for('nodejs.util.promisify.custom')] = mergeAllAsync;
14322
15441
  * }
14323
15442
  * }
14324
15443
  * })
14325
- *
15444
+ * ```
14326
15445
  * 3) Generic visitors that trigger upon entering and leaving any node.
14327
- *
15446
+ * ```
14328
15447
  * visit(ast, {
14329
15448
  * enter(node) {
14330
15449
  * // enter any node
@@ -14333,9 +15452,9 @@ mergeAll[Symbol.for('nodejs.util.promisify.custom')] = mergeAllAsync;
14333
15452
  * // leave any node
14334
15453
  * }
14335
15454
  * })
14336
- *
15455
+ * ```
14337
15456
  * 4) Parallel visitors for entering and leaving nodes of a specific kind.
14338
- *
15457
+ * ```
14339
15458
  * visit(ast, {
14340
15459
  * enter: {
14341
15460
  * Kind(node) {
@@ -14348,9 +15467,12 @@ mergeAll[Symbol.for('nodejs.util.promisify.custom')] = mergeAllAsync;
14348
15467
  * }
14349
15468
  * }
14350
15469
  * })
15470
+ * ```
15471
+ * sig `visit :: (Node, Visitor, Options)`
14351
15472
  *
14352
- * @sig visit :: (Node, Visitor, Options)
14353
- * @sig Options = { keyMap: Object, state: Object }
15473
+ * sig `Options = { keyMap: Object, state: Object }`
15474
+ *
15475
+ * @public
14354
15476
  */
14355
15477
  const visit = (
14356
15478
  // @ts-ignore
@@ -14690,7 +15812,7 @@ visitor, {
14690
15812
 
14691
15813
  /***/ }),
14692
15814
 
14693
- /***/ 1244:
15815
+ /***/ 3757:
14694
15816
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14695
15817
 
14696
15818
  "use strict";
@@ -14698,8 +15820,16 @@ __webpack_require__.r(__webpack_exports__);
14698
15820
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14699
15821
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14700
15822
  /* harmony export */ });
14701
- /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2449);
15823
+ /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4641);
15824
+
15825
+
15826
+ /**
15827
+ * @public
15828
+ */
14702
15829
 
15830
+ /**
15831
+ * @public
15832
+ */
14703
15833
  class CloneError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"] {
14704
15834
  value;
14705
15835
  constructor(message, structuredOptions) {
@@ -14713,7 +15843,7 @@ class CloneError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__[
14713
15843
 
14714
15844
  /***/ }),
14715
15845
 
14716
- /***/ 426:
15846
+ /***/ 9112:
14717
15847
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14718
15848
 
14719
15849
  "use strict";
@@ -14721,14 +15851,17 @@ __webpack_require__.r(__webpack_exports__);
14721
15851
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14722
15852
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14723
15853
  /* harmony export */ });
14724
- /* harmony import */ var _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1244);
15854
+ /* harmony import */ var _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3757);
14725
15855
 
15856
+ /**
15857
+ * @public
15858
+ */
14726
15859
  class DeepCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
14727
15860
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DeepCloneError);
14728
15861
 
14729
15862
  /***/ }),
14730
15863
 
14731
- /***/ 8774:
15864
+ /***/ 6500:
14732
15865
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14733
15866
 
14734
15867
  "use strict";
@@ -14736,14 +15869,17 @@ __webpack_require__.r(__webpack_exports__);
14736
15869
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14737
15870
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14738
15871
  /* harmony export */ });
14739
- /* harmony import */ var _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1244);
15872
+ /* harmony import */ var _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3757);
14740
15873
 
15874
+ /**
15875
+ * @public
15876
+ */
14741
15877
  class ShallowCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
14742
15878
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ShallowCloneError);
14743
15879
 
14744
15880
  /***/ }),
14745
15881
 
14746
- /***/ 4831:
15882
+ /***/ 6941:
14747
15883
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14748
15884
 
14749
15885
  "use strict";
@@ -14753,13 +15889,22 @@ __webpack_require__.r(__webpack_exports__);
14753
15889
  /* harmony export */ cloneShallow: () => (/* binding */ cloneShallow)
14754
15890
  /* harmony export */ });
14755
15891
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8326);
14756
- /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60);
14757
- /* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(426);
14758
- /* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8774);
15892
+ /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(726);
15893
+ /* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9112);
15894
+ /* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6500);
14759
15895
 
14760
15896
 
14761
15897
 
14762
15898
 
15899
+ /**
15900
+ * @public
15901
+ */
15902
+ /**
15903
+ * @public
15904
+ */
15905
+ /**
15906
+ * @public
15907
+ */
14763
15908
  const cloneDeep = (value, options = {}) => {
14764
15909
  const {
14765
15910
  visited = new WeakMap()
@@ -14870,6 +16015,9 @@ const cloneShallowElement = element => {
14870
16015
  };
14871
16016
  /* eslint-enable */
14872
16017
 
16018
+ /**
16019
+ * @public
16020
+ */
14873
16021
  const cloneShallow = value => {
14874
16022
  if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair) {
14875
16023
  return cloneShallowKeyValuePair(value);
@@ -14897,7 +16045,7 @@ cloneShallow.safe = value => {
14897
16045
 
14898
16046
  /***/ }),
14899
16047
 
14900
- /***/ 1460:
16048
+ /***/ 4102:
14901
16049
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14902
16050
 
14903
16051
  "use strict";
@@ -14907,6 +16055,10 @@ __webpack_require__.r(__webpack_exports__);
14907
16055
  /* harmony export */ });
14908
16056
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8326);
14909
16057
 
16058
+
16059
+ /**
16060
+ * @public
16061
+ */
14910
16062
  class Annotation extends minim__WEBPACK_IMPORTED_MODULE_0__.StringElement {
14911
16063
  // classes: warning | error
14912
16064
 
@@ -14925,7 +16077,7 @@ class Annotation extends minim__WEBPACK_IMPORTED_MODULE_0__.StringElement {
14925
16077
 
14926
16078
  /***/ }),
14927
16079
 
14928
- /***/ 5534:
16080
+ /***/ 68:
14929
16081
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14930
16082
 
14931
16083
  "use strict";
@@ -14935,6 +16087,10 @@ __webpack_require__.r(__webpack_exports__);
14935
16087
  /* harmony export */ });
14936
16088
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8326);
14937
16089
 
16090
+
16091
+ /**
16092
+ * @public
16093
+ */
14938
16094
  class Comment extends minim__WEBPACK_IMPORTED_MODULE_0__.StringElement {
14939
16095
  constructor(content, meta, attributes) {
14940
16096
  super(content, meta, attributes);
@@ -14945,7 +16101,7 @@ class Comment extends minim__WEBPACK_IMPORTED_MODULE_0__.StringElement {
14945
16101
 
14946
16102
  /***/ }),
14947
16103
 
14948
- /***/ 6439:
16104
+ /***/ 8737:
14949
16105
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14950
16106
 
14951
16107
  "use strict";
@@ -14957,6 +16113,10 @@ __webpack_require__.r(__webpack_exports__);
14957
16113
  /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3031);
14958
16114
 
14959
16115
 
16116
+
16117
+ /**
16118
+ * @public
16119
+ */
14960
16120
  class ParseResult extends minim__WEBPACK_IMPORTED_MODULE_0__.ArrayElement {
14961
16121
  constructor(content, meta, attributes) {
14962
16122
  super(content, meta, attributes);
@@ -15004,7 +16164,7 @@ class ParseResult extends minim__WEBPACK_IMPORTED_MODULE_0__.ArrayElement {
15004
16164
 
15005
16165
  /***/ }),
15006
16166
 
15007
- /***/ 2738:
16167
+ /***/ 1364:
15008
16168
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15009
16169
 
15010
16170
  "use strict";
@@ -15014,6 +16174,18 @@ __webpack_require__.r(__webpack_exports__);
15014
16174
  /* harmony export */ });
15015
16175
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8326);
15016
16176
 
16177
+
16178
+ /**
16179
+ * @public
16180
+ */
16181
+
16182
+ /**
16183
+ * @public
16184
+ */
16185
+
16186
+ /**
16187
+ * @public
16188
+ */
15017
16189
  class SourceMap extends minim__WEBPACK_IMPORTED_MODULE_0__.ArrayElement {
15018
16190
  constructor(content, meta, attributes) {
15019
16191
  super(content, meta, attributes);
@@ -15040,33 +16212,89 @@ class SourceMap extends minim__WEBPACK_IMPORTED_MODULE_0__.ArrayElement {
15040
16212
 
15041
16213
  /***/ }),
15042
16214
 
15043
- /***/ 1787:
16215
+ /***/ 145:
15044
16216
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15045
16217
 
15046
16218
  "use strict";
15047
16219
  __webpack_require__.r(__webpack_exports__);
15048
16220
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15049
16221
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
15050
- /* harmony export */ isElementType: () => (/* binding */ isElementType)
16222
+ /* harmony export */ hasBasicElementProps: () => (/* binding */ hasBasicElementProps),
16223
+ /* harmony export */ hasClass: () => (/* binding */ hasClass),
16224
+ /* harmony export */ hasMethod: () => (/* binding */ hasMethod),
16225
+ /* harmony export */ isElementType: () => (/* binding */ isElementType),
16226
+ /* harmony export */ primitiveEq: () => (/* binding */ primitiveEq)
15051
16227
  /* harmony export */ });
15052
16228
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8326);
15053
16229
 
16230
+
16231
+ /**
16232
+ * @public
16233
+ */
16234
+
16235
+ /**
16236
+ * @public
16237
+ */
16238
+
16239
+ /**
16240
+ * @public
16241
+ */
16242
+
16243
+ /**
16244
+ * @public
16245
+ */
16246
+
16247
+ /**
16248
+ * @public
16249
+ */
16250
+
16251
+ /**
16252
+ * @public
16253
+ */
16254
+
16255
+ /**
16256
+ * @public
16257
+ */
16258
+
16259
+ /**
16260
+ * @public
16261
+ */
15054
16262
  const hasMethod = (name, element) => {
15055
16263
  return typeof element === 'object' && element !== null && name in element && typeof element[name] === 'function';
15056
16264
  };
16265
+
16266
+ /**
16267
+ * @public
16268
+ */
15057
16269
  const hasBasicElementProps = element => typeof element === 'object' && element != null && '_storedElement' in element && typeof element._storedElement === 'string' &&
15058
16270
  // eslint-disable-line no-underscore-dangle
15059
16271
  '_content' in element;
16272
+
16273
+ /**
16274
+ * @public
16275
+ */
15060
16276
  const primitiveEq = (val, element) => {
15061
16277
  if (typeof element === 'object' && element !== null && 'primitive' in element) {
15062
16278
  return typeof element.primitive === 'function' && element.primitive() === val;
15063
16279
  }
15064
16280
  return false;
15065
16281
  };
16282
+
16283
+ /**
16284
+ * @public
16285
+ */
15066
16286
  const hasClass = (cls, element) => {
15067
16287
  return typeof element === 'object' && element !== null && 'classes' in element && (Array.isArray(element.classes) || element.classes instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArrayElement) && element.classes.includes(cls);
15068
16288
  };
16289
+
16290
+ /**
16291
+ * @public
16292
+ */
15069
16293
  const isElementType = (name, element) => typeof element === 'object' && element !== null && 'element' in element && element.element === name;
16294
+
16295
+ /**
16296
+ * @public
16297
+ */
15070
16298
  const createPredicate = predicateCreator => {
15071
16299
  return predicateCreator({
15072
16300
  hasMethod,
@@ -15080,7 +16308,7 @@ const createPredicate = predicateCreator => {
15080
16308
 
15081
16309
  /***/ }),
15082
16310
 
15083
- /***/ 60:
16311
+ /***/ 726:
15084
16312
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15085
16313
 
15086
16314
  "use strict";
@@ -15108,11 +16336,11 @@ __webpack_require__.r(__webpack_exports__);
15108
16336
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8326);
15109
16337
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5380);
15110
16338
  /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3699);
15111
- /* harmony import */ var _elements_Annotation_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1460);
15112
- /* harmony import */ var _elements_Comment_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5534);
15113
- /* harmony import */ var _elements_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6439);
15114
- /* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2738);
15115
- /* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1787);
16339
+ /* harmony import */ var _elements_Annotation_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4102);
16340
+ /* harmony import */ var _elements_Comment_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68);
16341
+ /* harmony import */ var _elements_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8737);
16342
+ /* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1364);
16343
+ /* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(145);
15116
16344
 
15117
16345
 
15118
16346
 
@@ -15121,36 +16349,59 @@ __webpack_require__.r(__webpack_exports__);
15121
16349
 
15122
16350
 
15123
16351
 
16352
+ /**
16353
+ * @public
16354
+ */
15124
16355
  const isElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15125
16356
  hasBasicElementProps,
15126
16357
  primitiveEq
15127
16358
  }) => {
15128
16359
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.Element || hasBasicElementProps(element) && primitiveEq(undefined, element);
15129
16360
  });
16361
+
16362
+ /**
16363
+ * @public
16364
+ */
15130
16365
  const isStringElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15131
16366
  hasBasicElementProps,
15132
16367
  primitiveEq
15133
16368
  }) => {
15134
16369
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.StringElement || hasBasicElementProps(element) && primitiveEq('string', element);
15135
16370
  });
16371
+
16372
+ /**
16373
+ * @public
16374
+ */
15136
16375
  const isNumberElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15137
16376
  hasBasicElementProps,
15138
16377
  primitiveEq
15139
16378
  }) => {
15140
16379
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.NumberElement || hasBasicElementProps(element) && primitiveEq('number', element);
15141
16380
  });
16381
+
16382
+ /**
16383
+ * @public
16384
+ */
15142
16385
  const isNullElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15143
16386
  hasBasicElementProps,
15144
16387
  primitiveEq
15145
16388
  }) => {
15146
16389
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.NullElement || hasBasicElementProps(element) && primitiveEq('null', element);
15147
16390
  });
16391
+
16392
+ /**
16393
+ * @public
16394
+ */
15148
16395
  const isBooleanElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15149
16396
  hasBasicElementProps,
15150
16397
  primitiveEq
15151
16398
  }) => {
15152
16399
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.BooleanElement || hasBasicElementProps(element) && primitiveEq('boolean', element);
15153
16400
  });
16401
+
16402
+ /**
16403
+ * @public
16404
+ */
15154
16405
  const isObjectElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15155
16406
  hasBasicElementProps,
15156
16407
  primitiveEq,
@@ -15158,6 +16409,10 @@ const isObjectElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])
15158
16409
  }) => {
15159
16410
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ObjectElement || hasBasicElementProps(element) && primitiveEq('object', element) && hasMethod('keys', element) && hasMethod('values', element) && hasMethod('items', element);
15160
16411
  });
16412
+
16413
+ /**
16414
+ * @public
16415
+ */
15161
16416
  const isArrayElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15162
16417
  hasBasicElementProps,
15163
16418
  primitiveEq,
@@ -15165,6 +16420,10 @@ const isArrayElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(
15165
16420
  }) => {
15166
16421
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArrayElement && !(element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ObjectElement) || hasBasicElementProps(element) && primitiveEq('array', element) && hasMethod('push', element) && hasMethod('unshift', element) && hasMethod('map', element) && hasMethod('reduce', element);
15167
16422
  });
16423
+
16424
+ /**
16425
+ * @public
16426
+ */
15168
16427
  const isMemberElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15169
16428
  hasBasicElementProps,
15170
16429
  isElementType,
@@ -15172,6 +16431,10 @@ const isMemberElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])
15172
16431
  }) => {
15173
16432
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.MemberElement || hasBasicElementProps(element) && isElementType('member', element) && primitiveEq(undefined, element);
15174
16433
  });
16434
+
16435
+ /**
16436
+ * @public
16437
+ */
15175
16438
  const isLinkElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15176
16439
  hasBasicElementProps,
15177
16440
  isElementType,
@@ -15179,6 +16442,10 @@ const isLinkElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])((
15179
16442
  }) => {
15180
16443
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.LinkElement || hasBasicElementProps(element) && isElementType('link', element) && primitiveEq(undefined, element);
15181
16444
  });
16445
+
16446
+ /**
16447
+ * @public
16448
+ */
15182
16449
  const isRefElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15183
16450
  hasBasicElementProps,
15184
16451
  isElementType,
@@ -15186,6 +16453,10 @@ const isRefElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15186
16453
  }) => {
15187
16454
  return element => element instanceof minim__WEBPACK_IMPORTED_MODULE_0__.RefElement || hasBasicElementProps(element) && isElementType('ref', element) && primitiveEq(undefined, element);
15188
16455
  });
16456
+
16457
+ /**
16458
+ * @public
16459
+ */
15189
16460
  const isAnnotationElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15190
16461
  hasBasicElementProps,
15191
16462
  isElementType,
@@ -15193,6 +16464,10 @@ const isAnnotationElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["defaul
15193
16464
  }) => {
15194
16465
  return element => element instanceof _elements_Annotation_mjs__WEBPACK_IMPORTED_MODULE_2__["default"] || hasBasicElementProps(element) && isElementType('annotation', element) && primitiveEq('array', element);
15195
16466
  });
16467
+
16468
+ /**
16469
+ * @public
16470
+ */
15196
16471
  const isCommentElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15197
16472
  hasBasicElementProps,
15198
16473
  isElementType,
@@ -15200,6 +16475,10 @@ const isCommentElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]
15200
16475
  }) => {
15201
16476
  return element => element instanceof _elements_Comment_mjs__WEBPACK_IMPORTED_MODULE_3__["default"] || hasBasicElementProps(element) && isElementType('comment', element) && primitiveEq('string', element);
15202
16477
  });
16478
+
16479
+ /**
16480
+ * @public
16481
+ */
15203
16482
  const isParseResultElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15204
16483
  hasBasicElementProps,
15205
16484
  isElementType,
@@ -15207,6 +16486,10 @@ const isParseResultElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["defau
15207
16486
  }) => {
15208
16487
  return element => element instanceof _elements_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_4__["default"] || hasBasicElementProps(element) && isElementType('parseResult', element) && primitiveEq('array', element);
15209
16488
  });
16489
+
16490
+ /**
16491
+ * @public
16492
+ */
15210
16493
  const isSourceMapElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(({
15211
16494
  hasBasicElementProps,
15212
16495
  isElementType,
@@ -15214,12 +16497,28 @@ const isSourceMapElement = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__["default
15214
16497
  }) => {
15215
16498
  return element => element instanceof _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__["default"] || hasBasicElementProps(element) && isElementType('sourceMap', element) && primitiveEq('array', element);
15216
16499
  });
16500
+
16501
+ /**
16502
+ * @public
16503
+ */
16504
+
16505
+ /**
16506
+ * @public
16507
+ */
15217
16508
  const isPrimitiveElement = element => {
15218
16509
  return (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__.isElementType)('object', element) || (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__.isElementType)('array', element) || (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__.isElementType)('boolean', element) || (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__.isElementType)('number', element) || (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__.isElementType)('string', element) || (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__.isElementType)('null', element) || (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_1__.isElementType)('member', element);
15219
16510
  };
16511
+
16512
+ /**
16513
+ * @public
16514
+ */
15220
16515
  const hasElementSourceMap = element => {
15221
16516
  return isSourceMapElement(element.meta.get('sourceMap'));
15222
16517
  };
16518
+
16519
+ /**
16520
+ * @public
16521
+ */
15223
16522
  const includesSymbols = (symbols, element) => {
15224
16523
  if (symbols.length === 0) {
15225
16524
  return true;
@@ -15230,6 +16529,10 @@ const includesSymbols = (symbols, element) => {
15230
16529
  }
15231
16530
  return (0,ramda__WEBPACK_IMPORTED_MODULE_6__["default"])((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_7__["default"])(elementSymbols.toValue()), symbols);
15232
16531
  };
16532
+
16533
+ /**
16534
+ * @public
16535
+ */
15233
16536
  const includesClasses = (classes, element) => {
15234
16537
  if (classes.length === 0) {
15235
16538
  return true;
@@ -15239,7 +16542,7 @@ const includesClasses = (classes, element) => {
15239
16542
 
15240
16543
  /***/ }),
15241
16544
 
15242
- /***/ 5330:
16545
+ /***/ 2136:
15243
16546
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15244
16547
 
15245
16548
  "use strict";
@@ -15267,7 +16570,7 @@ class EphemeralArray {
15267
16570
 
15268
16571
  /***/ }),
15269
16572
 
15270
- /***/ 1234:
16573
+ /***/ 2324:
15271
16574
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15272
16575
 
15273
16576
  "use strict";
@@ -15294,7 +16597,7 @@ class EphemeralObject {
15294
16597
 
15295
16598
  /***/ }),
15296
16599
 
15297
- /***/ 1514:
16600
+ /***/ 1776:
15298
16601
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15299
16602
 
15300
16603
  "use strict";
@@ -15302,10 +16605,10 @@ __webpack_require__.r(__webpack_exports__);
15302
16605
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15303
16606
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
15304
16607
  /* harmony export */ });
15305
- /* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9872);
15306
- /* harmony import */ var _ast_ephemeral_array_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5330);
15307
- /* harmony import */ var _ast_ephemeral_object_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1234);
15308
- /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60);
16608
+ /* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(162);
16609
+ /* harmony import */ var _ast_ephemeral_array_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2136);
16610
+ /* harmony import */ var _ast_ephemeral_object_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2324);
16611
+ /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(726);
15309
16612
 
15310
16613
 
15311
16614
 
@@ -15375,6 +16678,9 @@ class Visitor {
15375
16678
  return '';
15376
16679
  }
15377
16680
  }
16681
+ /**
16682
+ * @public
16683
+ */
15378
16684
  const serializer = element => {
15379
16685
  if (!(0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isElement)(element)) return element;
15380
16686
 
@@ -15388,7 +16694,7 @@ const serializer = element => {
15388
16694
 
15389
16695
  /***/ }),
15390
16696
 
15391
- /***/ 9872:
16697
+ /***/ 162:
15392
16698
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15393
16699
 
15394
16700
  "use strict";
@@ -15397,7 +16703,7 @@ __webpack_require__.r(__webpack_exports__);
15397
16703
  /* harmony export */ visit: () => (/* binding */ visit)
15398
16704
  /* harmony export */ });
15399
16705
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3679);
15400
- /* harmony import */ var _traversal_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5956);
16706
+ /* harmony import */ var _traversal_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7258);
15401
16707
 
15402
16708
 
15403
16709
  const nodeTypeGetter = node => {
@@ -15450,7 +16756,7 @@ visit[Symbol.for('nodejs.util.promisify.custom')] = async (root, {
15450
16756
 
15451
16757
  /***/ }),
15452
16758
 
15453
- /***/ 5956:
16759
+ /***/ 7258:
15454
16760
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15455
16761
 
15456
16762
  "use strict";
@@ -15468,9 +16774,9 @@ __webpack_require__.r(__webpack_exports__);
15468
16774
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7567);
15469
16775
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8833);
15470
16776
  /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5102);
15471
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7951);
15472
- /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60);
15473
- /* harmony import */ var _clone_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4831);
16777
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(331);
16778
+ /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(726);
16779
+ /* harmony import */ var _clone_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6941);
15474
16780
 
15475
16781
 
15476
16782
 
@@ -15478,7 +16784,9 @@ __webpack_require__.r(__webpack_exports__);
15478
16784
 
15479
16785
 
15480
16786
 
15481
- // getNodeType :: Node -> String
16787
+ /**
16788
+ * @public
16789
+ */
15482
16790
  const getNodeType = element => {
15483
16791
  /*
15484
16792
  * We're translating every possible higher element type to primitive minim type here.
@@ -15490,7 +16798,9 @@ const getNodeType = element => {
15490
16798
  return (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(element) ? 'ObjectElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isArrayElement)(element) ? 'ArrayElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isMemberElement)(element) ? 'MemberElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(element) ? 'StringElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isBooleanElement)(element) ? 'BooleanElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isNumberElement)(element) ? 'NumberElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isNullElement)(element) ? 'NullElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isLinkElement)(element) ? 'LinkElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isRefElement)(element) ? 'RefElement' : undefined;
15491
16799
  };
15492
16800
 
15493
- // cloneNode :: a -> a
16801
+ /**
16802
+ * @public
16803
+ */
15494
16804
  const cloneNode = node => {
15495
16805
  if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(node)) {
15496
16806
  return (0,_clone_index_mjs__WEBPACK_IMPORTED_MODULE_2__.cloneShallow)(node);
@@ -15500,6 +16810,10 @@ const cloneNode = node => {
15500
16810
 
15501
16811
  // isNode :: Node -> Boolean
15502
16812
  const isNode = (0,ramda__WEBPACK_IMPORTED_MODULE_3__["default"])(getNodeType, ramda_adjunct__WEBPACK_IMPORTED_MODULE_4__["default"]);
16813
+
16814
+ /**
16815
+ * @public
16816
+ */
15503
16817
  const keyMapDefault = {
15504
16818
  ObjectElement: ['content'],
15505
16819
  ArrayElement: ['content'],
@@ -15538,6 +16852,10 @@ class PredicateVisitor {
15538
16852
  return this.returnOnFalse;
15539
16853
  }
15540
16854
  }
16855
+
16856
+ /**
16857
+ * @public
16858
+ */
15541
16859
  const visit = (root,
15542
16860
  // @ts-ignore
15543
16861
  visitor, {
@@ -15577,7 +16895,7 @@ visitor, {
15577
16895
 
15578
16896
  /***/ }),
15579
16897
 
15580
- /***/ 6173:
16898
+ /***/ 3437:
15581
16899
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15582
16900
 
15583
16901
  "use strict";
@@ -15587,6 +16905,9 @@ __webpack_require__.r(__webpack_exports__);
15587
16905
  /* harmony export */ });
15588
16906
  /* harmony import */ var _babel_runtime_corejs3_core_js_aggregate_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1212);
15589
16907
 
16908
+ /**
16909
+ * @public
16910
+ */
15590
16911
  class ApiDOMAggregateError extends _babel_runtime_corejs3_core_js_aggregate_error__WEBPACK_IMPORTED_MODULE_0__ {
15591
16912
  constructor(errors, message, options) {
15592
16913
  super(errors, message, options);
@@ -15619,7 +16940,7 @@ class ApiDOMAggregateError extends _babel_runtime_corejs3_core_js_aggregate_erro
15619
16940
 
15620
16941
  /***/ }),
15621
16942
 
15622
- /***/ 5262:
16943
+ /***/ 6126:
15623
16944
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15624
16945
 
15625
16946
  "use strict";
@@ -15627,8 +16948,11 @@ __webpack_require__.r(__webpack_exports__);
15627
16948
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15628
16949
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
15629
16950
  /* harmony export */ });
15630
- /* harmony import */ var _ApiDOMAggregateError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6173);
16951
+ /* harmony import */ var _ApiDOMAggregateError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3437);
15631
16952
 
16953
+ /**
16954
+ * @public
16955
+ */
15632
16956
  class ApiDOMError extends Error {
15633
16957
  static [Symbol.hasInstance](instance) {
15634
16958
  // we want to ApiDOMAggregateError to act as if ApiDOMError was its superclass
@@ -15665,7 +16989,7 @@ class ApiDOMError extends Error {
15665
16989
 
15666
16990
  /***/ }),
15667
16991
 
15668
- /***/ 2449:
16992
+ /***/ 4641:
15669
16993
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15670
16994
 
15671
16995
  "use strict";
@@ -15673,8 +16997,11 @@ __webpack_require__.r(__webpack_exports__);
15673
16997
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15674
16998
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
15675
16999
  /* harmony export */ });
15676
- /* harmony import */ var _ApiDOMError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5262);
17000
+ /* harmony import */ var _ApiDOMError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6126);
15677
17001
 
17002
+ /**
17003
+ * @public
17004
+ */
15678
17005
  class ApiDOMStructuredError extends _ApiDOMError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
15679
17006
  constructor(message, structuredOptions) {
15680
17007
  super(message, structuredOptions);
@@ -15691,7 +17018,7 @@ class ApiDOMStructuredError extends _ApiDOMError_mjs__WEBPACK_IMPORTED_MODULE_0_
15691
17018
 
15692
17019
  /***/ }),
15693
17020
 
15694
- /***/ 4659:
17021
+ /***/ 2131:
15695
17022
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15696
17023
 
15697
17024
  "use strict";
@@ -15699,8 +17026,14 @@ __webpack_require__.r(__webpack_exports__);
15699
17026
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15700
17027
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
15701
17028
  /* harmony export */ });
15702
- /* harmony import */ var _JsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9249);
17029
+ /* harmony import */ var _JsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9217);
15703
17030
 
17031
+ /**
17032
+ * @public
17033
+ */
17034
+ /**
17035
+ * @public
17036
+ */
15704
17037
  class EvaluationJsonPointerError extends _JsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
15705
17038
  pointer;
15706
17039
  tokens;
@@ -15724,7 +17057,7 @@ class EvaluationJsonPointerError extends _JsonPointerError_mjs__WEBPACK_IMPORTED
15724
17057
 
15725
17058
  /***/ }),
15726
17059
 
15727
- /***/ 9060:
17060
+ /***/ 2900:
15728
17061
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15729
17062
 
15730
17063
  "use strict";
@@ -15732,8 +17065,14 @@ __webpack_require__.r(__webpack_exports__);
15732
17065
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15733
17066
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
15734
17067
  /* harmony export */ });
15735
- /* harmony import */ var _JsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9249);
17068
+ /* harmony import */ var _JsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9217);
15736
17069
 
17070
+ /**
17071
+ * @public
17072
+ */
17073
+ /**
17074
+ * @public
17075
+ */
15737
17076
  class InvalidJsonPointerError extends _JsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
15738
17077
  pointer;
15739
17078
  constructor(message, structuredOptions) {
@@ -15747,7 +17086,7 @@ class InvalidJsonPointerError extends _JsonPointerError_mjs__WEBPACK_IMPORTED_MO
15747
17086
 
15748
17087
  /***/ }),
15749
17088
 
15750
- /***/ 9249:
17089
+ /***/ 9217:
15751
17090
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15752
17091
 
15753
17092
  "use strict";
@@ -15755,14 +17094,18 @@ __webpack_require__.r(__webpack_exports__);
15755
17094
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15756
17095
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
15757
17096
  /* harmony export */ });
15758
- /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2449);
17097
+ /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4641);
15759
17098
 
17099
+
17100
+ /**
17101
+ * @public
17102
+ */
15760
17103
  class JsonPointerError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"] {}
15761
17104
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JsonPointerError);
15762
17105
 
15763
17106
  /***/ }),
15764
17107
 
15765
- /***/ 1581:
17108
+ /***/ 7453:
15766
17109
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15767
17110
 
15768
17111
  "use strict";
@@ -15771,14 +17114,18 @@ __webpack_require__.r(__webpack_exports__);
15771
17114
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
15772
17115
  /* harmony export */ });
15773
17116
  /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6201);
15774
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4831);
15775
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60);
15776
- /* harmony import */ var _parse_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8969);
15777
- /* harmony import */ var _errors_EvaluationJsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4659);
17117
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6941);
17118
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(726);
17119
+ /* harmony import */ var _parse_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4409);
17120
+ /* harmony import */ var _errors_EvaluationJsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2131);
17121
+
15778
17122
 
15779
17123
 
15780
17124
 
15781
- // evaluates JSON Pointer against ApiDOM fragment
17125
+ /**
17126
+ * Evaluates JSON Pointer against ApiDOM fragment.
17127
+ * @public
17128
+ */
15782
17129
  const evaluate = (pointer, element) => {
15783
17130
  let tokens;
15784
17131
  try {
@@ -15831,7 +17178,7 @@ const evaluate = (pointer, element) => {
15831
17178
 
15832
17179
  /***/ }),
15833
17180
 
15834
- /***/ 8969:
17181
+ /***/ 4409:
15835
17182
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15836
17183
 
15837
17184
  "use strict";
@@ -15847,12 +17194,15 @@ __webpack_require__.r(__webpack_exports__);
15847
17194
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6561);
15848
17195
  /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(687);
15849
17196
  /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4988);
15850
- /* harmony import */ var _unescape_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1736);
15851
- /* harmony import */ var _errors_InvalidJsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9060);
17197
+ /* harmony import */ var _unescape_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7800);
17198
+ /* harmony import */ var _errors_InvalidJsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2900);
15852
17199
 
15853
17200
 
15854
17201
 
15855
- // parse :: String -> String[]
17202
+
17203
+ /**
17204
+ * @public
17205
+ */
15856
17206
  const parse = pointer => {
15857
17207
  if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__["default"])(pointer)) {
15858
17208
  return [];
@@ -15885,7 +17235,9 @@ const getHash = uri => {
15885
17235
  return '#';
15886
17236
  };
15887
17237
 
15888
- // uriToPointer :: String -> String
17238
+ /**
17239
+ * @public
17240
+ */
15889
17241
  const uriToPointer = uri => {
15890
17242
  const hash = getHash(uri);
15891
17243
  return (0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_8__["default"])('#', hash);
@@ -15894,7 +17246,7 @@ const uriToPointer = uri => {
15894
17246
 
15895
17247
  /***/ }),
15896
17248
 
15897
- /***/ 1736:
17249
+ /***/ 7800:
15898
17250
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
15899
17251
 
15900
17252
  "use strict";
@@ -15920,7 +17272,9 @@ const safeDecodeURIComponent = encodedURIComponent => {
15920
17272
  }
15921
17273
  };
15922
17274
 
15923
- // unescape :: String -> String
17275
+ /**
17276
+ * @public
17277
+ */
15924
17278
  const unescape = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])((0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(/~1/g, '/'), (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(/~0/g, '~'), safeDecodeURIComponent);
15925
17279
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (unescape);
15926
17280
 
@@ -16007,20 +17361,21 @@ const unescape = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])((0,ramda__WEB
16007
17361
  /******/
16008
17362
  /************************************************************************/
16009
17363
  var __webpack_exports__ = {};
16010
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
17364
+ // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
16011
17365
  (() => {
16012
17366
  "use strict";
16013
17367
  __webpack_require__.r(__webpack_exports__);
16014
17368
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16015
- /* harmony export */ EvaluationJsonPathError: () => (/* reexport safe */ _errors_EvaluationJsonPathError__WEBPACK_IMPORTED_MODULE_0__["default"]),
16016
- /* harmony export */ MultiEvaluationJsonPathError: () => (/* reexport safe */ _errors_MultiEvaluationJsonPathError__WEBPACK_IMPORTED_MODULE_1__["default"]),
16017
- /* harmony export */ evaluate: () => (/* reexport safe */ _evaluate__WEBPACK_IMPORTED_MODULE_2__["default"]),
16018
- /* harmony export */ evaluateMulti: () => (/* reexport safe */ _evaluate_multi__WEBPACK_IMPORTED_MODULE_3__["default"])
17369
+ /* harmony export */ EvaluationJsonPathError: () => (/* reexport safe */ _errors_EvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_0__["default"]),
17370
+ /* harmony export */ MultiEvaluationJsonPathError: () => (/* reexport safe */ _errors_MultiEvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_1__["default"]),
17371
+ /* harmony export */ evaluate: () => (/* reexport safe */ _evaluate_ts__WEBPACK_IMPORTED_MODULE_2__["default"]),
17372
+ /* harmony export */ evaluateMulti: () => (/* reexport safe */ _evaluate_multi_ts__WEBPACK_IMPORTED_MODULE_3__["default"])
16019
17373
  /* harmony export */ });
16020
- /* harmony import */ var _errors_EvaluationJsonPathError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3424);
16021
- /* harmony import */ var _errors_MultiEvaluationJsonPathError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(427);
16022
- /* harmony import */ var _evaluate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1272);
16023
- /* harmony import */ var _evaluate_multi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6792);
17374
+ /* harmony import */ var _errors_EvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3424);
17375
+ /* harmony import */ var _errors_MultiEvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(427);
17376
+ /* harmony import */ var _evaluate_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1272);
17377
+ /* harmony import */ var _evaluate_multi_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6792);
17378
+
16024
17379
 
16025
17380
 
16026
17381