@swagger-api/apidom-json-pointer 0.79.0 → 0.81.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.
- package/CHANGELOG.md +8 -0
- package/cjs/errors/EvaluationJsonPointerError.cjs +1 -5
- package/cjs/evaluate.cjs +4 -4
- package/dist/apidom-json-pointer.browser.js +76 -985
- package/dist/apidom-json-pointer.browser.min.js +1 -1
- package/es/errors/EvaluationJsonPointerError.mjs +1 -5
- package/es/evaluate.mjs +5 -5
- package/package.json +4 -4
- package/types/dist.d.ts +1 -2
|
@@ -72,11 +72,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72
72
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
73
73
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
74
74
|
/* harmony export */ });
|
|
75
|
-
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6903);
|
|
76
|
-
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3130);
|
|
77
75
|
/* harmony import */ var _JsonPointerError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1341);
|
|
78
76
|
|
|
79
|
-
|
|
80
77
|
class EvaluationJsonPointerError extends _JsonPointerError__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
81
78
|
constructor(message, structuredOptions) {
|
|
82
79
|
super(message, structuredOptions);
|
|
@@ -87,10 +84,7 @@ class EvaluationJsonPointerError extends _JsonPointerError__WEBPACK_IMPORTED_MOD
|
|
|
87
84
|
}
|
|
88
85
|
this.failedToken = structuredOptions.failedToken;
|
|
89
86
|
this.failedTokenPosition = structuredOptions.failedTokenPosition;
|
|
90
|
-
this.element = structuredOptions.element
|
|
91
|
-
if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.hasElementSourceMap)(structuredOptions.element)) {
|
|
92
|
-
this.elementSourceMap = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(structuredOptions.element.getMetaProperty('sourceMap'));
|
|
93
|
-
}
|
|
87
|
+
this.element = structuredOptions.element;
|
|
94
88
|
}
|
|
95
89
|
}
|
|
96
90
|
}
|
|
@@ -161,8 +155,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
161
155
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
162
156
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
163
157
|
/* harmony export */ });
|
|
164
|
-
/* harmony import */ var
|
|
165
|
-
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
158
|
+
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5662);
|
|
159
|
+
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2434);
|
|
160
|
+
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6903);
|
|
166
161
|
/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2441);
|
|
167
162
|
/* harmony import */ var _errors_EvaluationJsonPointerError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1015);
|
|
168
163
|
|
|
@@ -178,12 +173,12 @@ const evaluate = (pointer, element) => {
|
|
|
178
173
|
} catch (error) {
|
|
179
174
|
throw new _errors_EvaluationJsonPointerError__WEBPACK_IMPORTED_MODULE_1__["default"](`JSON Pointer evaluation failed while parsing the pointer "${pointer}".`, {
|
|
180
175
|
pointer,
|
|
181
|
-
element,
|
|
176
|
+
element: (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(element),
|
|
182
177
|
cause: error
|
|
183
178
|
});
|
|
184
179
|
}
|
|
185
180
|
return tokens.reduce((acc, token, tokenPosition) => {
|
|
186
|
-
if ((0,
|
|
181
|
+
if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.isObjectElement)(acc)) {
|
|
187
182
|
// @ts-ignore
|
|
188
183
|
if (!acc.hasKey(token)) {
|
|
189
184
|
throw new _errors_EvaluationJsonPointerError__WEBPACK_IMPORTED_MODULE_1__["default"](`JSON Pointer evaluation failed while evaluating token "${token}" against an ObjectElement`, {
|
|
@@ -191,20 +186,20 @@ const evaluate = (pointer, element) => {
|
|
|
191
186
|
tokens,
|
|
192
187
|
failedToken: token,
|
|
193
188
|
failedTokenPosition: tokenPosition,
|
|
194
|
-
element: acc
|
|
189
|
+
element: (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(acc)
|
|
195
190
|
});
|
|
196
191
|
}
|
|
197
192
|
// @ts-ignore
|
|
198
193
|
return acc.get(token);
|
|
199
194
|
}
|
|
200
|
-
if ((0,
|
|
201
|
-
if (!(token in acc.content) || !(0,
|
|
195
|
+
if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.isArrayElement)(acc)) {
|
|
196
|
+
if (!(token in acc.content) || !(0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_4__["default"])(Number(token))) {
|
|
202
197
|
throw new _errors_EvaluationJsonPointerError__WEBPACK_IMPORTED_MODULE_1__["default"](`JSON Pointer evaluation failed while evaluating token "${token}" against an ArrayElement`, {
|
|
203
198
|
pointer,
|
|
204
199
|
tokens,
|
|
205
200
|
failedToken: token,
|
|
206
201
|
failedTokenPosition: tokenPosition,
|
|
207
|
-
element: acc
|
|
202
|
+
element: (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(acc)
|
|
208
203
|
});
|
|
209
204
|
}
|
|
210
205
|
// @ts-ignore
|
|
@@ -215,7 +210,7 @@ const evaluate = (pointer, element) => {
|
|
|
215
210
|
tokens,
|
|
216
211
|
failedToken: token,
|
|
217
212
|
failedTokenPosition: tokenPosition,
|
|
218
|
-
element: acc
|
|
213
|
+
element: (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(acc)
|
|
219
214
|
});
|
|
220
215
|
}, element);
|
|
221
216
|
};
|
|
@@ -9602,41 +9597,6 @@ var isPlainObj = (0,ramda__WEBPACK_IMPORTED_MODULE_8__["default"])(1, function (
|
|
|
9602
9597
|
|
|
9603
9598
|
/***/ }),
|
|
9604
9599
|
|
|
9605
|
-
/***/ 5992:
|
|
9606
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9607
|
-
|
|
9608
|
-
"use strict";
|
|
9609
|
-
__webpack_require__.r(__webpack_exports__);
|
|
9610
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9611
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
9612
|
-
/* harmony export */ });
|
|
9613
|
-
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7616);
|
|
9614
|
-
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4205);
|
|
9615
|
-
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2406);
|
|
9616
|
-
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2776);
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
/**
|
|
9620
|
-
* Checks if input value is `String`.
|
|
9621
|
-
*
|
|
9622
|
-
* @func isString
|
|
9623
|
-
* @memberOf RA
|
|
9624
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.4.0|v0.4.0}
|
|
9625
|
-
* @category Type
|
|
9626
|
-
* @sig * -> Boolean
|
|
9627
|
-
* @param {*} val The value to test
|
|
9628
|
-
* @return {boolean}
|
|
9629
|
-
* @see {@link RA.isNotString|isNotString}
|
|
9630
|
-
* @example
|
|
9631
|
-
*
|
|
9632
|
-
* RA.isString('abc'); //=> true
|
|
9633
|
-
* RA.isString(1); //=> false
|
|
9634
|
-
*/
|
|
9635
|
-
var isString = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(1, (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(ramda__WEBPACK_IMPORTED_MODULE_2__["default"], (0,ramda__WEBPACK_IMPORTED_MODULE_3__["default"])('String')));
|
|
9636
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isString);
|
|
9637
|
-
|
|
9638
|
-
/***/ }),
|
|
9639
|
-
|
|
9640
9600
|
/***/ 9471:
|
|
9641
9601
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9642
9602
|
|
|
@@ -9743,13 +9703,6 @@ var trimCharsStart = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(function
|
|
|
9743
9703
|
|
|
9744
9704
|
/***/ }),
|
|
9745
9705
|
|
|
9746
|
-
/***/ 6591:
|
|
9747
|
-
/***/ ((module) => {
|
|
9748
|
-
|
|
9749
|
-
!function(){"use strict";var u,c,a,s,f,y="properties",l="deepProperties",b="propertyDescriptors",d="staticProperties",O="staticDeepProperties",h="staticPropertyDescriptors",g="configuration",m="deepConfiguration",P="deepProps",A="deepStatics",j="deepConf",v="initializers",_="methods",w="composers",D="compose";function S(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[])}function r(r,t){return Array.prototype.slice.call(arguments,2).reduce(r,t)}var x=r.bind(0,function r(t,e){if(e)for(var n=S(e),o=0;o<n.length;o+=1)Object.defineProperty(t,n[o],Object.getOwnPropertyDescriptor(e,n[o]));return t});function C(r){return"function"==typeof r}function N(r){return r&&"object"==typeof r||C(r)}function z(r){return r&&"object"==typeof r&&r.__proto__==Object.prototype}var E=r.bind(0,function r(t,e){if(e===u)return t;if(Array.isArray(e))return(Array.isArray(t)?t:[]).concat(e);if(!z(e))return e;for(var n,o,i=S(e),p=0;p<i.length;)n=i[p++],(o=Object.getOwnPropertyDescriptor(e,n)).hasOwnProperty("value")?o.value!==u&&(t[n]=r(z(t[n])||Array.isArray(e[n])?t[n]:{},e[n])):Object.defineProperty(t,n,o);return t});function I(){return(c=Array.prototype.concat.apply([],arguments).filter(function(r,t,e){return C(r)&&e.indexOf(r)===t})).length?c:u}function t(r){return c=function r(){return function r(t){var e,n,o=r[D]||{},i={__proto__:o[_]},p=o[v],c=Array.prototype.slice.apply(arguments),a=o[l];if(a&&E(i,a),(a=o[y])&&x(i,a),(a=o[b])&&Object.defineProperties(i,a),!p||!p.length)return i;for(t===u&&(t={}),o=0;o<p.length;)C(e=p[o++])&&(i=(n=e.call(i,t,{instance:i,stamp:r,args:c}))===u?i:n);return i}}(),(a=r[O])&&E(c,a),(a=r[d])&&x(c,a),(a=r[h])&&Object.defineProperties(c,a),a=C(c[D])?c[D]:R,x(c[D]=function(){return a.apply(this,arguments)},r),c}function e(e,n){function r(r,t){N(n[r])&&(N(e[r])||(e[r]={}),(t||x)(e[r],n[r]))}function t(r){(c=I(e[r],n[r]))&&(e[r]=c)}return n&&N(n=n[D]||n)&&(r(_),r(y),r(l,E),r(b),r(d),r(O,E),r(h),r(g),r(m,E),t(v),t(w)),e}function R(){return t(Array.prototype.concat.apply([this],arguments).reduce(e,{}))}function V(r){return C(r)&&C(r[D])}var n={};function o(r,t){return function(){return(s={})[r]=t.apply(u,Array.prototype.concat.apply([{}],arguments)),((c=this)&&c[D]||a).call(c,s)}}n[_]=o(_,x),n[y]=n.props=o(y,x),n[v]=n.init=o(v,I),n[w]=o(w,I),n[l]=n[P]=o(l,E),n[d]=n.statics=o(d,x),n[O]=n[A]=o(O,E),n[g]=n.conf=o(g,x),n[m]=n[j]=o(m,E),n[b]=o(b,x),n[h]=o(h,x),a=n[D]=x(function r(){for(var t,e,n=0,o=[],i=arguments,p=this;n<i.length;)N(t=i[n++])&&o.push(V(t)?t:((s={})[_]=(e=t)[_]||u,a=e.props,s[y]=N((c=e[y])||a)?x({},a,c):u,s[v]=I(e.init,e[v]),s[w]=I(e[w]),a=e[P],s[l]=N((c=e[l])||a)?E({},a,c):u,s[b]=e[b],a=e.statics,s[d]=N((c=e[d])||a)?x({},a,c):u,a=e[A],s[O]=N((c=e[O])||a)?E({},a,c):u,c=e[h],s[h]=N((a=e.name&&{name:{value:e.name}})||c)?x({},c,a):u,a=e.conf,s[g]=N((c=e[g])||a)?x({},a,c):u,a=e[j],s[m]=N((c=e[m])||a)?E({},a,c):u,s));if(t=R.apply(p||f,o),p&&o.unshift(p),Array.isArray(i=t[D][w]))for(n=0;n<i.length;)t=V(p=i[n++]({stamp:t,composables:o}))?p:t;return t},n),n.create=function(){return this.apply(u,arguments)},(s={})[d]=n,f=R(s),a[D]=a.bind(),a.version="4.3.2",typeof u!="object"?module.exports=a:self.stampit=a}();
|
|
9750
|
-
|
|
9751
|
-
/***/ }),
|
|
9752
|
-
|
|
9753
9706
|
/***/ 1427:
|
|
9754
9707
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
9755
9708
|
|
|
@@ -9757,68 +9710,6 @@ module.exports = __webpack_require__(6762);
|
|
|
9757
9710
|
|
|
9758
9711
|
/***/ }),
|
|
9759
9712
|
|
|
9760
|
-
/***/ 5561:
|
|
9761
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
9762
|
-
|
|
9763
|
-
"use strict";
|
|
9764
|
-
__webpack_require__.r(__webpack_exports__);
|
|
9765
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9766
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
9767
|
-
/* harmony export */ });
|
|
9768
|
-
/**
|
|
9769
|
-
* A function that always returns `false`. Any passed in parameters are ignored.
|
|
9770
|
-
*
|
|
9771
|
-
* @func
|
|
9772
|
-
* @memberOf R
|
|
9773
|
-
* @since v0.9.0
|
|
9774
|
-
* @category Function
|
|
9775
|
-
* @sig * -> Boolean
|
|
9776
|
-
* @param {*}
|
|
9777
|
-
* @return {Boolean}
|
|
9778
|
-
* @see R.T
|
|
9779
|
-
* @example
|
|
9780
|
-
*
|
|
9781
|
-
* R.F(); //=> false
|
|
9782
|
-
*/
|
|
9783
|
-
var F = function () {
|
|
9784
|
-
return false;
|
|
9785
|
-
};
|
|
9786
|
-
|
|
9787
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (F);
|
|
9788
|
-
|
|
9789
|
-
/***/ }),
|
|
9790
|
-
|
|
9791
|
-
/***/ 2335:
|
|
9792
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
9793
|
-
|
|
9794
|
-
"use strict";
|
|
9795
|
-
__webpack_require__.r(__webpack_exports__);
|
|
9796
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9797
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
9798
|
-
/* harmony export */ });
|
|
9799
|
-
/**
|
|
9800
|
-
* A function that always returns `true`. Any passed in parameters are ignored.
|
|
9801
|
-
*
|
|
9802
|
-
* @func
|
|
9803
|
-
* @memberOf R
|
|
9804
|
-
* @since v0.9.0
|
|
9805
|
-
* @category Function
|
|
9806
|
-
* @sig * -> Boolean
|
|
9807
|
-
* @param {*}
|
|
9808
|
-
* @return {Boolean}
|
|
9809
|
-
* @see R.F
|
|
9810
|
-
* @example
|
|
9811
|
-
*
|
|
9812
|
-
* R.T(); //=> true
|
|
9813
|
-
*/
|
|
9814
|
-
var T = function () {
|
|
9815
|
-
return true;
|
|
9816
|
-
};
|
|
9817
|
-
|
|
9818
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (T);
|
|
9819
|
-
|
|
9820
|
-
/***/ }),
|
|
9821
|
-
|
|
9822
9713
|
/***/ 7321:
|
|
9823
9714
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
9824
9715
|
|
|
@@ -14043,512 +13934,6 @@ var type =
|
|
|
14043
13934
|
|
|
14044
13935
|
/***/ }),
|
|
14045
13936
|
|
|
14046
|
-
/***/ 1394:
|
|
14047
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
14048
|
-
|
|
14049
|
-
"use strict";
|
|
14050
|
-
__webpack_require__.r(__webpack_exports__);
|
|
14051
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14052
|
-
/* harmony export */ BREAK: () => (/* binding */ BREAK),
|
|
14053
|
-
/* harmony export */ cloneNode: () => (/* binding */ cloneNode),
|
|
14054
|
-
/* harmony export */ getNodeType: () => (/* binding */ getNodeType),
|
|
14055
|
-
/* harmony export */ getVisitFn: () => (/* binding */ getVisitFn),
|
|
14056
|
-
/* harmony export */ isNode: () => (/* binding */ isNode),
|
|
14057
|
-
/* harmony export */ mergeAll: () => (/* binding */ mergeAll),
|
|
14058
|
-
/* harmony export */ visit: () => (/* binding */ visit)
|
|
14059
|
-
/* harmony export */ });
|
|
14060
|
-
/* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7471);
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
/**
|
|
14064
|
-
* SPDX-FileCopyrightText: Copyright (c) GraphQL Contributors
|
|
14065
|
-
*
|
|
14066
|
-
* SPDX-License-Identifier: MIT
|
|
14067
|
-
*/
|
|
14068
|
-
|
|
14069
|
-
// getVisitFn :: (Visitor, String, Boolean) -> Function
|
|
14070
|
-
const getVisitFn = (visitor, type, isLeaving) => {
|
|
14071
|
-
const typeVisitor = visitor[type];
|
|
14072
|
-
if (typeVisitor != null) {
|
|
14073
|
-
if (!isLeaving && typeof typeVisitor === 'function') {
|
|
14074
|
-
// { Type() {} }
|
|
14075
|
-
return typeVisitor;
|
|
14076
|
-
}
|
|
14077
|
-
const typeSpecificVisitor = isLeaving ? typeVisitor.leave : typeVisitor.enter;
|
|
14078
|
-
if (typeof typeSpecificVisitor === 'function') {
|
|
14079
|
-
// { Type: { enter() {}, leave() {} } }
|
|
14080
|
-
return typeSpecificVisitor;
|
|
14081
|
-
}
|
|
14082
|
-
} else {
|
|
14083
|
-
const specificVisitor = isLeaving ? visitor.leave : visitor.enter;
|
|
14084
|
-
if (specificVisitor != null) {
|
|
14085
|
-
if (typeof specificVisitor === 'function') {
|
|
14086
|
-
// { enter() {}, leave() {} }
|
|
14087
|
-
return specificVisitor;
|
|
14088
|
-
}
|
|
14089
|
-
const specificTypeVisitor = specificVisitor[type];
|
|
14090
|
-
if (typeof specificTypeVisitor === 'function') {
|
|
14091
|
-
// { enter: { Type() {} }, leave: { Type() {} } }
|
|
14092
|
-
return specificTypeVisitor;
|
|
14093
|
-
}
|
|
14094
|
-
}
|
|
14095
|
-
}
|
|
14096
|
-
return null;
|
|
14097
|
-
};
|
|
14098
|
-
const BREAK = {};
|
|
14099
|
-
|
|
14100
|
-
// getNodeType :: Node -> String
|
|
14101
|
-
const getNodeType = node => node === null || node === void 0 ? void 0 : node.type;
|
|
14102
|
-
|
|
14103
|
-
// isNode :: Node -> Boolean
|
|
14104
|
-
const isNode = node => typeof getNodeType(node) === 'string';
|
|
14105
|
-
|
|
14106
|
-
// cloneNode :: a -> a
|
|
14107
|
-
const cloneNode = node => Object.create(Object.getPrototypeOf(node), Object.getOwnPropertyDescriptors(node));
|
|
14108
|
-
|
|
14109
|
-
/**
|
|
14110
|
-
* Creates a new visitor instance which delegates to many visitors to run in
|
|
14111
|
-
* parallel. Each visitor will be visited for each node before moving on.
|
|
14112
|
-
*
|
|
14113
|
-
* If a prior visitor edits a node, no following visitors will see that node.
|
|
14114
|
-
*/
|
|
14115
|
-
const mergeAll = (visitors, {
|
|
14116
|
-
visitFnGetter = getVisitFn,
|
|
14117
|
-
nodeTypeGetter = getNodeType
|
|
14118
|
-
} = {}) => {
|
|
14119
|
-
const skipping = new Array(visitors.length).fill(null);
|
|
14120
|
-
return {
|
|
14121
|
-
enter(node, ...rest) {
|
|
14122
|
-
for (let i = 0; i < visitors.length; i += 1) {
|
|
14123
|
-
if (skipping[i] === null) {
|
|
14124
|
-
const fn = visitFnGetter(visitors[i], nodeTypeGetter(node), /* isLeaving */false);
|
|
14125
|
-
if (typeof fn === 'function') {
|
|
14126
|
-
const result = fn.call(visitors[i], node, ...rest);
|
|
14127
|
-
if (result === false) {
|
|
14128
|
-
skipping[i] = node;
|
|
14129
|
-
} else if (result === BREAK) {
|
|
14130
|
-
skipping[i] = BREAK;
|
|
14131
|
-
} else if (result !== undefined) {
|
|
14132
|
-
return result;
|
|
14133
|
-
}
|
|
14134
|
-
}
|
|
14135
|
-
}
|
|
14136
|
-
}
|
|
14137
|
-
return undefined;
|
|
14138
|
-
},
|
|
14139
|
-
leave(node, ...rest) {
|
|
14140
|
-
for (let i = 0; i < visitors.length; i += 1) {
|
|
14141
|
-
if (skipping[i] === null) {
|
|
14142
|
-
const fn = visitFnGetter(visitors[i], nodeTypeGetter(node), /* isLeaving */true);
|
|
14143
|
-
if (typeof fn === 'function') {
|
|
14144
|
-
const result = fn.call(visitors[i], node, ...rest);
|
|
14145
|
-
if (result === BREAK) {
|
|
14146
|
-
skipping[i] = BREAK;
|
|
14147
|
-
} else if (result !== undefined && result !== false) {
|
|
14148
|
-
return result;
|
|
14149
|
-
}
|
|
14150
|
-
}
|
|
14151
|
-
} else if (skipping[i] === node) {
|
|
14152
|
-
skipping[i] = null;
|
|
14153
|
-
}
|
|
14154
|
-
}
|
|
14155
|
-
return undefined;
|
|
14156
|
-
}
|
|
14157
|
-
};
|
|
14158
|
-
};
|
|
14159
|
-
|
|
14160
|
-
/* eslint-disable no-continue, no-nested-ternary, no-param-reassign */
|
|
14161
|
-
/**
|
|
14162
|
-
* visit() will walk through an AST using a preorder depth first traversal, calling
|
|
14163
|
-
* the visitor's enter function at each node in the traversal, and calling the
|
|
14164
|
-
* leave function after visiting that node and all of its child nodes.
|
|
14165
|
-
*
|
|
14166
|
-
* By returning different values from the enter and leave functions, the
|
|
14167
|
-
* behavior of the visitor can be altered, including skipping over a sub-tree of
|
|
14168
|
-
* the AST (by returning false), editing the AST by returning a value or null
|
|
14169
|
-
* to remove the value, or to stop the whole traversal by returning BREAK.
|
|
14170
|
-
*
|
|
14171
|
-
* When using visit() to edit an AST, the original AST will not be modified, and
|
|
14172
|
-
* a new version of the AST with the changes applied will be returned from the
|
|
14173
|
-
* visit function.
|
|
14174
|
-
*
|
|
14175
|
-
* const editedAST = visit(ast, {
|
|
14176
|
-
* enter(node, key, parent, path, ancestors) {
|
|
14177
|
-
* // @return
|
|
14178
|
-
* // undefined: no action
|
|
14179
|
-
* // false: skip visiting this node
|
|
14180
|
-
* // BREAK: stop visiting altogether
|
|
14181
|
-
* // null: delete this node
|
|
14182
|
-
* // any value: replace this node with the returned value
|
|
14183
|
-
* },
|
|
14184
|
-
* leave(node, key, parent, path, ancestors) {
|
|
14185
|
-
* // @return
|
|
14186
|
-
* // undefined: no action
|
|
14187
|
-
* // false: no action
|
|
14188
|
-
* // BREAK: stop visiting altogether
|
|
14189
|
-
* // null: delete this node
|
|
14190
|
-
* // any value: replace this node with the returned value
|
|
14191
|
-
* }
|
|
14192
|
-
* });
|
|
14193
|
-
*
|
|
14194
|
-
* Alternatively to providing enter() and leave() functions, a visitor can
|
|
14195
|
-
* instead provide functions named the same as the kinds of AST nodes, or
|
|
14196
|
-
* enter/leave visitors at a named key, leading to four permutations of
|
|
14197
|
-
* visitor API:
|
|
14198
|
-
*
|
|
14199
|
-
* 1) Named visitors triggered when entering a node a specific kind.
|
|
14200
|
-
*
|
|
14201
|
-
* visit(ast, {
|
|
14202
|
-
* Kind(node) {
|
|
14203
|
-
* // enter the "Kind" node
|
|
14204
|
-
* }
|
|
14205
|
-
* })
|
|
14206
|
-
*
|
|
14207
|
-
* 2) Named visitors that trigger upon entering and leaving a node of
|
|
14208
|
-
* a specific kind.
|
|
14209
|
-
*
|
|
14210
|
-
* visit(ast, {
|
|
14211
|
-
* Kind: {
|
|
14212
|
-
* enter(node) {
|
|
14213
|
-
* // enter the "Kind" node
|
|
14214
|
-
* }
|
|
14215
|
-
* leave(node) {
|
|
14216
|
-
* // leave the "Kind" node
|
|
14217
|
-
* }
|
|
14218
|
-
* }
|
|
14219
|
-
* })
|
|
14220
|
-
*
|
|
14221
|
-
* 3) Generic visitors that trigger upon entering and leaving any node.
|
|
14222
|
-
*
|
|
14223
|
-
* visit(ast, {
|
|
14224
|
-
* enter(node) {
|
|
14225
|
-
* // enter any node
|
|
14226
|
-
* },
|
|
14227
|
-
* leave(node) {
|
|
14228
|
-
* // leave any node
|
|
14229
|
-
* }
|
|
14230
|
-
* })
|
|
14231
|
-
*
|
|
14232
|
-
* 4) Parallel visitors for entering and leaving nodes of a specific kind.
|
|
14233
|
-
*
|
|
14234
|
-
* visit(ast, {
|
|
14235
|
-
* enter: {
|
|
14236
|
-
* Kind(node) {
|
|
14237
|
-
* // enter the "Kind" node
|
|
14238
|
-
* }
|
|
14239
|
-
* },
|
|
14240
|
-
* leave: {
|
|
14241
|
-
* Kind(node) {
|
|
14242
|
-
* // leave the "Kind" node
|
|
14243
|
-
* }
|
|
14244
|
-
* }
|
|
14245
|
-
* })
|
|
14246
|
-
*
|
|
14247
|
-
* @sig visit :: (Node, Visitor, Options)
|
|
14248
|
-
* @sig Options = { keyMap: Object, state: Object }
|
|
14249
|
-
*/
|
|
14250
|
-
const visit = (
|
|
14251
|
-
// @ts-ignore
|
|
14252
|
-
root,
|
|
14253
|
-
// @ts-ignore
|
|
14254
|
-
visitor, {
|
|
14255
|
-
keyMap = null,
|
|
14256
|
-
state = {},
|
|
14257
|
-
breakSymbol = BREAK,
|
|
14258
|
-
deleteNodeSymbol = null,
|
|
14259
|
-
skipVisitingNodeSymbol = false,
|
|
14260
|
-
visitFnGetter = getVisitFn,
|
|
14261
|
-
nodeTypeGetter = getNodeType,
|
|
14262
|
-
nodePredicate = isNode,
|
|
14263
|
-
nodeCloneFn = cloneNode,
|
|
14264
|
-
detectCycles = true
|
|
14265
|
-
} = {}) => {
|
|
14266
|
-
const visitorKeys = keyMap || {};
|
|
14267
|
-
let stack;
|
|
14268
|
-
let inArray = Array.isArray(root);
|
|
14269
|
-
let keys = [root];
|
|
14270
|
-
let index = -1;
|
|
14271
|
-
let parent;
|
|
14272
|
-
let edits = [];
|
|
14273
|
-
let node = root;
|
|
14274
|
-
const path = [];
|
|
14275
|
-
// @ts-ignore
|
|
14276
|
-
const ancestors = [];
|
|
14277
|
-
do {
|
|
14278
|
-
index += 1;
|
|
14279
|
-
const isLeaving = index === keys.length;
|
|
14280
|
-
let key;
|
|
14281
|
-
const isEdited = isLeaving && edits.length !== 0;
|
|
14282
|
-
if (isLeaving) {
|
|
14283
|
-
key = ancestors.length === 0 ? undefined : path.pop();
|
|
14284
|
-
node = parent;
|
|
14285
|
-
// @ts-ignore
|
|
14286
|
-
parent = ancestors.pop();
|
|
14287
|
-
if (isEdited) {
|
|
14288
|
-
if (inArray) {
|
|
14289
|
-
// @ts-ignore; creating clone
|
|
14290
|
-
node = node.slice();
|
|
14291
|
-
let editOffset = 0;
|
|
14292
|
-
for (const [editKey, editValue] of edits) {
|
|
14293
|
-
const arrayKey = editKey - editOffset;
|
|
14294
|
-
if (editValue === deleteNodeSymbol) {
|
|
14295
|
-
node.splice(arrayKey, 1);
|
|
14296
|
-
editOffset += 1;
|
|
14297
|
-
} else {
|
|
14298
|
-
node[arrayKey] = editValue;
|
|
14299
|
-
}
|
|
14300
|
-
}
|
|
14301
|
-
} else {
|
|
14302
|
-
// creating clone
|
|
14303
|
-
node = nodeCloneFn(node);
|
|
14304
|
-
for (const [editKey, editValue] of edits) {
|
|
14305
|
-
node[editKey] = editValue;
|
|
14306
|
-
}
|
|
14307
|
-
}
|
|
14308
|
-
}
|
|
14309
|
-
index = stack.index;
|
|
14310
|
-
keys = stack.keys;
|
|
14311
|
-
// @ts-ignore
|
|
14312
|
-
edits = stack.edits;
|
|
14313
|
-
// @ts-ignore
|
|
14314
|
-
inArray = stack.inArray;
|
|
14315
|
-
// @ts-ignore
|
|
14316
|
-
stack = stack.prev;
|
|
14317
|
-
} else if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
14318
|
-
key = inArray ? index : keys[index];
|
|
14319
|
-
node = parent[key];
|
|
14320
|
-
if (node === deleteNodeSymbol || node === undefined) {
|
|
14321
|
-
continue;
|
|
14322
|
-
}
|
|
14323
|
-
path.push(key);
|
|
14324
|
-
}
|
|
14325
|
-
if (ancestors.includes(node)) {
|
|
14326
|
-
continue;
|
|
14327
|
-
}
|
|
14328
|
-
let result;
|
|
14329
|
-
if (!Array.isArray(node)) {
|
|
14330
|
-
if (!nodePredicate(node)) {
|
|
14331
|
-
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${JSON.stringify(node)}`);
|
|
14332
|
-
}
|
|
14333
|
-
|
|
14334
|
-
// cycle detected; skipping over a sub-tree to avoid recursion
|
|
14335
|
-
if (detectCycles && ancestors.includes(node)) {
|
|
14336
|
-
path.pop();
|
|
14337
|
-
continue;
|
|
14338
|
-
}
|
|
14339
|
-
// call appropriate visitor function if available
|
|
14340
|
-
const visitFn = visitFnGetter(visitor, nodeTypeGetter(node), isLeaving);
|
|
14341
|
-
if (visitFn) {
|
|
14342
|
-
// assign state
|
|
14343
|
-
for (const [stateKey, stateValue] of Object.entries(state)) {
|
|
14344
|
-
visitor[stateKey] = stateValue;
|
|
14345
|
-
}
|
|
14346
|
-
// retrieve result
|
|
14347
|
-
result = visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
14348
|
-
}
|
|
14349
|
-
if (result === breakSymbol) {
|
|
14350
|
-
break;
|
|
14351
|
-
}
|
|
14352
|
-
if (result === skipVisitingNodeSymbol) {
|
|
14353
|
-
if (!isLeaving) {
|
|
14354
|
-
path.pop();
|
|
14355
|
-
continue;
|
|
14356
|
-
}
|
|
14357
|
-
} else if (result !== undefined) {
|
|
14358
|
-
edits.push([key, result]);
|
|
14359
|
-
if (!isLeaving) {
|
|
14360
|
-
if (nodePredicate(result)) {
|
|
14361
|
-
node = result;
|
|
14362
|
-
} else {
|
|
14363
|
-
path.pop();
|
|
14364
|
-
continue;
|
|
14365
|
-
}
|
|
14366
|
-
}
|
|
14367
|
-
}
|
|
14368
|
-
}
|
|
14369
|
-
if (result === undefined && isEdited) {
|
|
14370
|
-
edits.push([key, node]);
|
|
14371
|
-
}
|
|
14372
|
-
if (!isLeaving) {
|
|
14373
|
-
var _visitorKeys$nodeType;
|
|
14374
|
-
stack = {
|
|
14375
|
-
inArray,
|
|
14376
|
-
index,
|
|
14377
|
-
keys,
|
|
14378
|
-
edits,
|
|
14379
|
-
prev: stack
|
|
14380
|
-
};
|
|
14381
|
-
inArray = Array.isArray(node);
|
|
14382
|
-
// @ts-ignore
|
|
14383
|
-
keys = inArray ? node : (_visitorKeys$nodeType = visitorKeys[nodeTypeGetter(node)]) !== null && _visitorKeys$nodeType !== void 0 ? _visitorKeys$nodeType : [];
|
|
14384
|
-
index = -1;
|
|
14385
|
-
edits = [];
|
|
14386
|
-
if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
14387
|
-
ancestors.push(parent);
|
|
14388
|
-
}
|
|
14389
|
-
parent = node;
|
|
14390
|
-
}
|
|
14391
|
-
} while (stack !== undefined);
|
|
14392
|
-
if (edits.length !== 0) {
|
|
14393
|
-
return edits.at(-1)[1];
|
|
14394
|
-
}
|
|
14395
|
-
return root;
|
|
14396
|
-
};
|
|
14397
|
-
|
|
14398
|
-
/**
|
|
14399
|
-
* Asynchronous version of visit.
|
|
14400
|
-
*/
|
|
14401
|
-
// @ts-ignore
|
|
14402
|
-
visit[Symbol.for('nodejs.util.promisify.custom')] = async (
|
|
14403
|
-
// @ts-ignore
|
|
14404
|
-
root,
|
|
14405
|
-
// @ts-ignore
|
|
14406
|
-
visitor, {
|
|
14407
|
-
keyMap = null,
|
|
14408
|
-
state = {},
|
|
14409
|
-
breakSymbol = BREAK,
|
|
14410
|
-
deleteNodeSymbol = null,
|
|
14411
|
-
skipVisitingNodeSymbol = false,
|
|
14412
|
-
visitFnGetter = getVisitFn,
|
|
14413
|
-
nodeTypeGetter = getNodeType,
|
|
14414
|
-
nodePredicate = isNode,
|
|
14415
|
-
nodeCloneFn = cloneNode,
|
|
14416
|
-
detectCycles = true
|
|
14417
|
-
} = {}) => {
|
|
14418
|
-
const visitorKeys = keyMap || {};
|
|
14419
|
-
let stack;
|
|
14420
|
-
let inArray = Array.isArray(root);
|
|
14421
|
-
let keys = [root];
|
|
14422
|
-
let index = -1;
|
|
14423
|
-
let parent;
|
|
14424
|
-
let edits = [];
|
|
14425
|
-
let node = root;
|
|
14426
|
-
const path = [];
|
|
14427
|
-
// @ts-ignore
|
|
14428
|
-
const ancestors = [];
|
|
14429
|
-
do {
|
|
14430
|
-
index += 1;
|
|
14431
|
-
const isLeaving = index === keys.length;
|
|
14432
|
-
let key;
|
|
14433
|
-
const isEdited = isLeaving && edits.length !== 0;
|
|
14434
|
-
if (isLeaving) {
|
|
14435
|
-
key = ancestors.length === 0 ? undefined : path.pop();
|
|
14436
|
-
node = parent;
|
|
14437
|
-
// @ts-ignore
|
|
14438
|
-
parent = ancestors.pop();
|
|
14439
|
-
if (isEdited) {
|
|
14440
|
-
if (inArray) {
|
|
14441
|
-
// @ts-ignore; creating clone
|
|
14442
|
-
node = node.slice();
|
|
14443
|
-
let editOffset = 0;
|
|
14444
|
-
for (const [editKey, editValue] of edits) {
|
|
14445
|
-
const arrayKey = editKey - editOffset;
|
|
14446
|
-
if (editValue === deleteNodeSymbol) {
|
|
14447
|
-
node.splice(arrayKey, 1);
|
|
14448
|
-
editOffset += 1;
|
|
14449
|
-
} else {
|
|
14450
|
-
node[arrayKey] = editValue;
|
|
14451
|
-
}
|
|
14452
|
-
}
|
|
14453
|
-
} else {
|
|
14454
|
-
// creating clone
|
|
14455
|
-
node = nodeCloneFn(node);
|
|
14456
|
-
for (const [editKey, editValue] of edits) {
|
|
14457
|
-
node[editKey] = editValue;
|
|
14458
|
-
}
|
|
14459
|
-
}
|
|
14460
|
-
}
|
|
14461
|
-
index = stack.index;
|
|
14462
|
-
keys = stack.keys;
|
|
14463
|
-
// @ts-ignore
|
|
14464
|
-
edits = stack.edits;
|
|
14465
|
-
// @ts-ignore
|
|
14466
|
-
inArray = stack.inArray;
|
|
14467
|
-
// @ts-ignore
|
|
14468
|
-
stack = stack.prev;
|
|
14469
|
-
} else if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
14470
|
-
key = inArray ? index : keys[index];
|
|
14471
|
-
node = parent[key];
|
|
14472
|
-
if (node === deleteNodeSymbol || node === undefined) {
|
|
14473
|
-
continue;
|
|
14474
|
-
}
|
|
14475
|
-
path.push(key);
|
|
14476
|
-
}
|
|
14477
|
-
let result;
|
|
14478
|
-
if (!Array.isArray(node)) {
|
|
14479
|
-
if (!nodePredicate(node)) {
|
|
14480
|
-
throw new _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"](`Invalid AST Node: ${JSON.stringify(node)}`);
|
|
14481
|
-
}
|
|
14482
|
-
|
|
14483
|
-
// cycle detected; skipping over a sub-tree to avoid recursion
|
|
14484
|
-
if (detectCycles && ancestors.includes(node)) {
|
|
14485
|
-
path.pop();
|
|
14486
|
-
continue;
|
|
14487
|
-
}
|
|
14488
|
-
const visitFn = visitFnGetter(visitor, nodeTypeGetter(node), isLeaving);
|
|
14489
|
-
if (visitFn) {
|
|
14490
|
-
// assign state
|
|
14491
|
-
for (const [stateKey, stateValue] of Object.entries(state)) {
|
|
14492
|
-
visitor[stateKey] = stateValue;
|
|
14493
|
-
}
|
|
14494
|
-
|
|
14495
|
-
// retrieve result
|
|
14496
|
-
result = await visitFn.call(visitor, node, key, parent, path, ancestors); // eslint-disable-line no-await-in-loop
|
|
14497
|
-
}
|
|
14498
|
-
|
|
14499
|
-
if (result === breakSymbol) {
|
|
14500
|
-
break;
|
|
14501
|
-
}
|
|
14502
|
-
if (result === skipVisitingNodeSymbol) {
|
|
14503
|
-
if (!isLeaving) {
|
|
14504
|
-
path.pop();
|
|
14505
|
-
continue;
|
|
14506
|
-
}
|
|
14507
|
-
} else if (result !== undefined) {
|
|
14508
|
-
edits.push([key, result]);
|
|
14509
|
-
if (!isLeaving) {
|
|
14510
|
-
if (nodePredicate(result)) {
|
|
14511
|
-
node = result;
|
|
14512
|
-
} else {
|
|
14513
|
-
path.pop();
|
|
14514
|
-
continue;
|
|
14515
|
-
}
|
|
14516
|
-
}
|
|
14517
|
-
}
|
|
14518
|
-
}
|
|
14519
|
-
if (result === undefined && isEdited) {
|
|
14520
|
-
edits.push([key, node]);
|
|
14521
|
-
}
|
|
14522
|
-
if (!isLeaving) {
|
|
14523
|
-
var _visitorKeys$nodeType2;
|
|
14524
|
-
stack = {
|
|
14525
|
-
inArray,
|
|
14526
|
-
index,
|
|
14527
|
-
keys,
|
|
14528
|
-
edits,
|
|
14529
|
-
prev: stack
|
|
14530
|
-
};
|
|
14531
|
-
inArray = Array.isArray(node);
|
|
14532
|
-
// @ts-ignore
|
|
14533
|
-
keys = inArray ? node : (_visitorKeys$nodeType2 = visitorKeys[nodeTypeGetter(node)]) !== null && _visitorKeys$nodeType2 !== void 0 ? _visitorKeys$nodeType2 : [];
|
|
14534
|
-
index = -1;
|
|
14535
|
-
edits = [];
|
|
14536
|
-
if (parent !== deleteNodeSymbol && parent !== undefined) {
|
|
14537
|
-
ancestors.push(parent);
|
|
14538
|
-
}
|
|
14539
|
-
parent = node;
|
|
14540
|
-
}
|
|
14541
|
-
} while (stack !== undefined);
|
|
14542
|
-
if (edits.length !== 0) {
|
|
14543
|
-
return edits.at(-1)[1];
|
|
14544
|
-
}
|
|
14545
|
-
return root;
|
|
14546
|
-
};
|
|
14547
|
-
|
|
14548
|
-
/* eslint-enable */
|
|
14549
|
-
|
|
14550
|
-
/***/ }),
|
|
14551
|
-
|
|
14552
13937
|
/***/ 9815:
|
|
14553
13938
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
14554
13939
|
|
|
@@ -14559,7 +13944,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14559
13944
|
/* harmony export */ });
|
|
14560
13945
|
/* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9985);
|
|
14561
13946
|
|
|
14562
|
-
class CloneError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
13947
|
+
class CloneError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
13948
|
+
constructor(message, structuredOptions) {
|
|
13949
|
+
super(message, structuredOptions);
|
|
13950
|
+
if (typeof structuredOptions !== 'undefined') {
|
|
13951
|
+
this.value = structuredOptions.source;
|
|
13952
|
+
}
|
|
13953
|
+
}
|
|
13954
|
+
}
|
|
14563
13955
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CloneError);
|
|
14564
13956
|
|
|
14565
13957
|
/***/ }),
|
|
@@ -14604,32 +13996,72 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14604
13996
|
/* harmony export */ cloneShallow: () => (/* binding */ cloneShallow)
|
|
14605
13997
|
/* harmony export */ });
|
|
14606
13998
|
/* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7952);
|
|
14607
|
-
/* harmony import */ var
|
|
14608
|
-
/* harmony import */ var
|
|
13999
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6903);
|
|
14000
|
+
/* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4646);
|
|
14609
14001
|
/* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(219);
|
|
14610
14002
|
|
|
14611
14003
|
|
|
14612
14004
|
|
|
14613
14005
|
|
|
14614
|
-
const
|
|
14615
|
-
|
|
14616
|
-
|
|
14006
|
+
const cloneDeep = (value, options = {}) => {
|
|
14007
|
+
const {
|
|
14008
|
+
visited = new WeakMap()
|
|
14009
|
+
} = options;
|
|
14010
|
+
const passThroughOptions = {
|
|
14011
|
+
...options,
|
|
14012
|
+
visited
|
|
14013
|
+
};
|
|
14014
|
+
|
|
14015
|
+
// detect cycle and return memoized value
|
|
14016
|
+
if (visited.has(value)) {
|
|
14017
|
+
return visited.get(value);
|
|
14018
|
+
}
|
|
14019
|
+
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair) {
|
|
14020
|
+
const {
|
|
14021
|
+
key,
|
|
14022
|
+
value: val
|
|
14023
|
+
} = value;
|
|
14024
|
+
const keyCopy = (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(key) ? cloneDeep(key, passThroughOptions) : key;
|
|
14025
|
+
const valueCopy = (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(val) ? cloneDeep(val, passThroughOptions) : val;
|
|
14026
|
+
const copy = new minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair(keyCopy, valueCopy);
|
|
14027
|
+
visited.set(value, copy);
|
|
14028
|
+
return copy;
|
|
14617
14029
|
}
|
|
14618
|
-
return value;
|
|
14619
|
-
};
|
|
14620
|
-
const cloneDeep = value => {
|
|
14621
14030
|
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice) {
|
|
14622
|
-
const
|
|
14623
|
-
|
|
14031
|
+
const mapper = element => cloneDeep(element, passThroughOptions);
|
|
14032
|
+
const items = [...value].map(mapper);
|
|
14033
|
+
const copy = new minim__WEBPACK_IMPORTED_MODULE_0__.ObjectSlice(items);
|
|
14034
|
+
visited.set(value, copy);
|
|
14035
|
+
return copy;
|
|
14624
14036
|
}
|
|
14625
14037
|
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice) {
|
|
14626
|
-
const
|
|
14627
|
-
|
|
14038
|
+
const mapper = element => cloneDeep(element, passThroughOptions);
|
|
14039
|
+
const items = [...value].map(mapper);
|
|
14040
|
+
const copy = new minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice(items);
|
|
14041
|
+
visited.set(value, copy);
|
|
14042
|
+
return copy;
|
|
14628
14043
|
}
|
|
14629
|
-
if (
|
|
14630
|
-
|
|
14044
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(value)) {
|
|
14045
|
+
const copy = cloneShallow(value); // eslint-disable-line @typescript-eslint/no-use-before-define
|
|
14046
|
+
|
|
14047
|
+
visited.set(value, copy);
|
|
14048
|
+
if (value.content) {
|
|
14049
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(value.content)) {
|
|
14050
|
+
copy.content = cloneDeep(value.content, passThroughOptions);
|
|
14051
|
+
} else if (value.content instanceof minim__WEBPACK_IMPORTED_MODULE_0__.KeyValuePair) {
|
|
14052
|
+
copy.content = cloneDeep(value.content, passThroughOptions);
|
|
14053
|
+
} else if (Array.isArray(value.content)) {
|
|
14054
|
+
const mapper = element => cloneDeep(element, passThroughOptions);
|
|
14055
|
+
copy.content = value.content.map(mapper);
|
|
14056
|
+
} else {
|
|
14057
|
+
copy.content = value.content;
|
|
14058
|
+
}
|
|
14059
|
+
} else {
|
|
14060
|
+
copy.content = value.content;
|
|
14061
|
+
}
|
|
14062
|
+
return copy;
|
|
14631
14063
|
}
|
|
14632
|
-
throw new
|
|
14064
|
+
throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]("Value provided to cloneDeep function couldn't be cloned", {
|
|
14633
14065
|
value
|
|
14634
14066
|
});
|
|
14635
14067
|
};
|
|
@@ -14667,7 +14099,7 @@ const cloneShallowElement = element => {
|
|
|
14667
14099
|
if (element.attributes.length > 0) {
|
|
14668
14100
|
copy._attributes = cloneDeep(element.attributes);
|
|
14669
14101
|
}
|
|
14670
|
-
if ((0,
|
|
14102
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(element.content)) {
|
|
14671
14103
|
const content = element.content;
|
|
14672
14104
|
copy.content = cloneShallowElement(content);
|
|
14673
14105
|
} else if (Array.isArray(element.content)) {
|
|
@@ -14691,7 +14123,7 @@ const cloneShallow = value => {
|
|
|
14691
14123
|
if (value instanceof minim__WEBPACK_IMPORTED_MODULE_0__.ArraySlice) {
|
|
14692
14124
|
return cloneShallowArraySlice(value);
|
|
14693
14125
|
}
|
|
14694
|
-
if ((0,
|
|
14126
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_1__.isElement)(value)) {
|
|
14695
14127
|
return cloneShallowElement(value);
|
|
14696
14128
|
}
|
|
14697
14129
|
throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]("Value provided to cloneShallow function couldn't be cloned", {
|
|
@@ -15050,347 +14482,6 @@ const includesClasses = (classes, element) => {
|
|
|
15050
14482
|
|
|
15051
14483
|
/***/ }),
|
|
15052
14484
|
|
|
15053
|
-
/***/ 6353:
|
|
15054
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
15055
|
-
|
|
15056
|
-
"use strict";
|
|
15057
|
-
__webpack_require__.r(__webpack_exports__);
|
|
15058
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15059
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
15060
|
-
/* harmony export */ });
|
|
15061
|
-
class EphemeralArray {
|
|
15062
|
-
type = 'EphemeralArray';
|
|
15063
|
-
content = [];
|
|
15064
|
-
reference = undefined;
|
|
15065
|
-
constructor(content) {
|
|
15066
|
-
this.content = content;
|
|
15067
|
-
this.reference = [];
|
|
15068
|
-
}
|
|
15069
|
-
toReference() {
|
|
15070
|
-
return this.reference;
|
|
15071
|
-
}
|
|
15072
|
-
toArray() {
|
|
15073
|
-
this.reference.push(...this.content);
|
|
15074
|
-
return this.reference;
|
|
15075
|
-
}
|
|
15076
|
-
}
|
|
15077
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EphemeralArray);
|
|
15078
|
-
|
|
15079
|
-
/***/ }),
|
|
15080
|
-
|
|
15081
|
-
/***/ 4575:
|
|
15082
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
15083
|
-
|
|
15084
|
-
"use strict";
|
|
15085
|
-
__webpack_require__.r(__webpack_exports__);
|
|
15086
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15087
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
15088
|
-
/* harmony export */ });
|
|
15089
|
-
class EphemeralObject {
|
|
15090
|
-
type = 'EphemeralObject';
|
|
15091
|
-
content = [];
|
|
15092
|
-
reference = undefined;
|
|
15093
|
-
constructor(content) {
|
|
15094
|
-
this.content = content;
|
|
15095
|
-
this.reference = {};
|
|
15096
|
-
}
|
|
15097
|
-
toReference() {
|
|
15098
|
-
return this.reference;
|
|
15099
|
-
}
|
|
15100
|
-
toObject() {
|
|
15101
|
-
return Object.assign(this.reference, Object.fromEntries(this.content));
|
|
15102
|
-
}
|
|
15103
|
-
}
|
|
15104
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EphemeralObject);
|
|
15105
|
-
|
|
15106
|
-
/***/ }),
|
|
15107
|
-
|
|
15108
|
-
/***/ 3130:
|
|
15109
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
15110
|
-
|
|
15111
|
-
"use strict";
|
|
15112
|
-
__webpack_require__.r(__webpack_exports__);
|
|
15113
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15114
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
15115
|
-
/* harmony export */ });
|
|
15116
|
-
/* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6591);
|
|
15117
|
-
/* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2056);
|
|
15118
|
-
/* harmony import */ var _ast_ephemeral_array_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6353);
|
|
15119
|
-
/* harmony import */ var _ast_ephemeral_object_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4575);
|
|
15120
|
-
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6903);
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
|
|
15125
|
-
|
|
15126
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
15127
|
-
const Visitor = stampit__WEBPACK_IMPORTED_MODULE_0__.init(function _Visitor() {
|
|
15128
|
-
const references = new WeakMap();
|
|
15129
|
-
this.BooleanElement = function _BooleanElement(element) {
|
|
15130
|
-
return element.toValue();
|
|
15131
|
-
};
|
|
15132
|
-
this.NumberElement = function _NumberElement(element) {
|
|
15133
|
-
return element.toValue();
|
|
15134
|
-
};
|
|
15135
|
-
this.StringElement = function _StringElement(element) {
|
|
15136
|
-
return element.toValue();
|
|
15137
|
-
};
|
|
15138
|
-
this.NullElement = function _NullElement() {
|
|
15139
|
-
return null;
|
|
15140
|
-
};
|
|
15141
|
-
this.ObjectElement = {
|
|
15142
|
-
enter(element) {
|
|
15143
|
-
if (references.has(element)) {
|
|
15144
|
-
return references.get(element).toReference();
|
|
15145
|
-
}
|
|
15146
|
-
const ephemeral = new _ast_ephemeral_object_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](element.content);
|
|
15147
|
-
references.set(element, ephemeral);
|
|
15148
|
-
return ephemeral;
|
|
15149
|
-
}
|
|
15150
|
-
};
|
|
15151
|
-
this.EphemeralObject = {
|
|
15152
|
-
leave(ephemeral) {
|
|
15153
|
-
return ephemeral.toObject();
|
|
15154
|
-
}
|
|
15155
|
-
};
|
|
15156
|
-
this.MemberElement = {
|
|
15157
|
-
enter(element) {
|
|
15158
|
-
return [element.key, element.value];
|
|
15159
|
-
}
|
|
15160
|
-
};
|
|
15161
|
-
this.ArrayElement = {
|
|
15162
|
-
enter(element) {
|
|
15163
|
-
if (references.has(element)) {
|
|
15164
|
-
return references.get(element).toReference();
|
|
15165
|
-
}
|
|
15166
|
-
const ephemeral = new _ast_ephemeral_array_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](element.content);
|
|
15167
|
-
references.set(element, ephemeral);
|
|
15168
|
-
return ephemeral;
|
|
15169
|
-
}
|
|
15170
|
-
};
|
|
15171
|
-
this.EphemeralArray = {
|
|
15172
|
-
leave(ephemeral) {
|
|
15173
|
-
return ephemeral.toArray();
|
|
15174
|
-
}
|
|
15175
|
-
};
|
|
15176
|
-
});
|
|
15177
|
-
/* eslint-enable */
|
|
15178
|
-
|
|
15179
|
-
const serializer = element => {
|
|
15180
|
-
if (!(0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isElement)(element)) return element;
|
|
15181
|
-
|
|
15182
|
-
// shortcut optimization for certain element types
|
|
15183
|
-
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isStringElement)(element) || (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isNumberElement)(element) || (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isBooleanElement)(element) || (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isNullElement)(element)) {
|
|
15184
|
-
return element.toValue();
|
|
15185
|
-
}
|
|
15186
|
-
return (0,_visitor_mjs__WEBPACK_IMPORTED_MODULE_4__.visit)(element, Visitor());
|
|
15187
|
-
};
|
|
15188
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (serializer);
|
|
15189
|
-
|
|
15190
|
-
/***/ }),
|
|
15191
|
-
|
|
15192
|
-
/***/ 2056:
|
|
15193
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
15194
|
-
|
|
15195
|
-
"use strict";
|
|
15196
|
-
__webpack_require__.r(__webpack_exports__);
|
|
15197
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15198
|
-
/* harmony export */ visit: () => (/* binding */ visit)
|
|
15199
|
-
/* harmony export */ });
|
|
15200
|
-
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2335);
|
|
15201
|
-
/* harmony import */ var _traversal_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(821);
|
|
15202
|
-
|
|
15203
|
-
|
|
15204
|
-
const nodeTypeGetter = node => {
|
|
15205
|
-
if (typeof (node === null || node === void 0 ? void 0 : node.type) === 'string') {
|
|
15206
|
-
return node.type;
|
|
15207
|
-
}
|
|
15208
|
-
return (0,_traversal_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__.getNodeType)(node);
|
|
15209
|
-
};
|
|
15210
|
-
const keyMapDefault = {
|
|
15211
|
-
EphemeralObject: ['content'],
|
|
15212
|
-
EphemeralArray: ['content'],
|
|
15213
|
-
..._traversal_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__.keyMapDefault
|
|
15214
|
-
};
|
|
15215
|
-
|
|
15216
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
15217
|
-
const visit = (root,
|
|
15218
|
-
// @ts-ignore
|
|
15219
|
-
visitor, {
|
|
15220
|
-
keyMap = keyMapDefault,
|
|
15221
|
-
...rest
|
|
15222
|
-
} = {}) => {
|
|
15223
|
-
return (0,_traversal_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__.visit)(root, visitor, {
|
|
15224
|
-
keyMap,
|
|
15225
|
-
// @ts-ignore
|
|
15226
|
-
nodeTypeGetter,
|
|
15227
|
-
nodePredicate: ramda__WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
15228
|
-
detectCycles: false,
|
|
15229
|
-
deleteNodeSymbol: Symbol.for('delete-node'),
|
|
15230
|
-
skipVisitingNodeSymbol: Symbol.for('skip-visiting-node'),
|
|
15231
|
-
...rest
|
|
15232
|
-
});
|
|
15233
|
-
};
|
|
15234
|
-
|
|
15235
|
-
// @ts-ignore
|
|
15236
|
-
visit[Symbol.for('nodejs.util.promisify.custom')] = async (root, {
|
|
15237
|
-
keyMap = keyMapDefault,
|
|
15238
|
-
...rest
|
|
15239
|
-
} = {}) => {
|
|
15240
|
-
// @ts-ignore
|
|
15241
|
-
return _traversal_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__.visit[Symbol.for('nodejs.util.promisify.custom')](root, visitor, {
|
|
15242
|
-
keyMap,
|
|
15243
|
-
nodeTypeGetter,
|
|
15244
|
-
nodePredicate: ramda__WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
15245
|
-
detectCycles: false,
|
|
15246
|
-
deleteNodeSymbol: Symbol.for('delete-node'),
|
|
15247
|
-
skipVisitingNodeSymbol: Symbol.for('skip-visiting-node'),
|
|
15248
|
-
...rest
|
|
15249
|
-
});
|
|
15250
|
-
};
|
|
15251
|
-
|
|
15252
|
-
/***/ }),
|
|
15253
|
-
|
|
15254
|
-
/***/ 821:
|
|
15255
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
15256
|
-
|
|
15257
|
-
"use strict";
|
|
15258
|
-
__webpack_require__.r(__webpack_exports__);
|
|
15259
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15260
|
-
/* harmony export */ BREAK: () => (/* reexport safe */ _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__.BREAK),
|
|
15261
|
-
/* harmony export */ PredicateVisitor: () => (/* binding */ PredicateVisitor),
|
|
15262
|
-
/* harmony export */ cloneNode: () => (/* binding */ cloneNode),
|
|
15263
|
-
/* harmony export */ getNodeType: () => (/* binding */ getNodeType),
|
|
15264
|
-
/* harmony export */ isNode: () => (/* binding */ isNode),
|
|
15265
|
-
/* harmony export */ keyMapDefault: () => (/* binding */ keyMapDefault),
|
|
15266
|
-
/* harmony export */ mergeAllVisitors: () => (/* reexport safe */ _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__.mergeAll),
|
|
15267
|
-
/* harmony export */ visit: () => (/* binding */ visit)
|
|
15268
|
-
/* harmony export */ });
|
|
15269
|
-
/* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6591);
|
|
15270
|
-
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4205);
|
|
15271
|
-
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5561);
|
|
15272
|
-
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5992);
|
|
15273
|
-
/* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1394);
|
|
15274
|
-
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6903);
|
|
15275
|
-
/* harmony import */ var _clone_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2434);
|
|
15276
|
-
|
|
15277
|
-
|
|
15278
|
-
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
|
|
15282
|
-
|
|
15283
|
-
|
|
15284
|
-
// getNodeType :: Node -> String
|
|
15285
|
-
const getNodeType = element => {
|
|
15286
|
-
/*
|
|
15287
|
-
* We're translating every possible higher element type to primitive minim type here.
|
|
15288
|
-
* We're using polymorphism to recognize any higher element type as ObjectElement or ArrayElement.
|
|
15289
|
-
* Using polymorphism allows us to assume any namespace.
|
|
15290
|
-
*
|
|
15291
|
-
* There is a problem with naming visitor methods described here: https://github.com/babel/babel/discussions/12874
|
|
15292
|
-
*/
|
|
15293
|
-
/* eslint-disable no-nested-ternary */
|
|
15294
|
-
return (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectElement)(element) ? 'ObjectElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isArrayElement)(element) ? 'ArrayElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isMemberElement)(element) ? 'MemberElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(element) ? 'StringElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isBooleanElement)(element) ? 'BooleanElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isNumberElement)(element) ? 'NumberElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isNullElement)(element) ? 'NullElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isLinkElement)(element) ? 'LinkElement' : (0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isRefElement)(element) ? 'RefElement' : undefined;
|
|
15295
|
-
/* eslint-enable */
|
|
15296
|
-
};
|
|
15297
|
-
|
|
15298
|
-
// cloneNode :: a -> a
|
|
15299
|
-
const cloneNode = node => {
|
|
15300
|
-
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isElement)(node)) {
|
|
15301
|
-
return (0,_clone_index_mjs__WEBPACK_IMPORTED_MODULE_3__.cloneShallow)(node);
|
|
15302
|
-
}
|
|
15303
|
-
return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__.cloneNode)(node);
|
|
15304
|
-
};
|
|
15305
|
-
|
|
15306
|
-
// isNode :: Node -> Boolean
|
|
15307
|
-
const isNode = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(getNodeType, ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"]);
|
|
15308
|
-
const keyMapDefault = {
|
|
15309
|
-
ObjectElement: ['content'],
|
|
15310
|
-
ArrayElement: ['content'],
|
|
15311
|
-
MemberElement: ['key', 'value'],
|
|
15312
|
-
StringElement: [],
|
|
15313
|
-
BooleanElement: [],
|
|
15314
|
-
NumberElement: [],
|
|
15315
|
-
NullElement: [],
|
|
15316
|
-
RefElement: [],
|
|
15317
|
-
LinkElement: [],
|
|
15318
|
-
Annotation: [],
|
|
15319
|
-
Comment: [],
|
|
15320
|
-
ParseResultElement: ['content'],
|
|
15321
|
-
SourceMap: ['content']
|
|
15322
|
-
};
|
|
15323
|
-
const PredicateVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
|
|
15324
|
-
props: {
|
|
15325
|
-
result: [],
|
|
15326
|
-
predicate: ramda__WEBPACK_IMPORTED_MODULE_6__["default"],
|
|
15327
|
-
returnOnTrue: undefined,
|
|
15328
|
-
returnOnFalse: undefined
|
|
15329
|
-
},
|
|
15330
|
-
init({
|
|
15331
|
-
// @ts-ignore
|
|
15332
|
-
predicate = this.predicate,
|
|
15333
|
-
// @ts-ignore
|
|
15334
|
-
returnOnTrue = this.returnOnTrue,
|
|
15335
|
-
// @ts-ignore
|
|
15336
|
-
returnOnFalse = this.returnOnFalse
|
|
15337
|
-
} = {}) {
|
|
15338
|
-
this.result = [];
|
|
15339
|
-
this.predicate = predicate;
|
|
15340
|
-
this.returnOnTrue = returnOnTrue;
|
|
15341
|
-
this.returnOnFalse = returnOnFalse;
|
|
15342
|
-
},
|
|
15343
|
-
methods: {
|
|
15344
|
-
enter(element) {
|
|
15345
|
-
if (this.predicate(element)) {
|
|
15346
|
-
this.result.push(element);
|
|
15347
|
-
return this.returnOnTrue;
|
|
15348
|
-
}
|
|
15349
|
-
return this.returnOnFalse;
|
|
15350
|
-
}
|
|
15351
|
-
}
|
|
15352
|
-
});
|
|
15353
|
-
|
|
15354
|
-
// @ts-ignore
|
|
15355
|
-
const visit = (root,
|
|
15356
|
-
// @ts-ignore
|
|
15357
|
-
visitor, {
|
|
15358
|
-
keyMap = keyMapDefault,
|
|
15359
|
-
...rest
|
|
15360
|
-
} = {}) => {
|
|
15361
|
-
// @ts-ignore
|
|
15362
|
-
return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__.visit)(root, visitor, {
|
|
15363
|
-
// @ts-ignore
|
|
15364
|
-
keyMap,
|
|
15365
|
-
// @ts-ignore
|
|
15366
|
-
nodeTypeGetter: getNodeType,
|
|
15367
|
-
nodePredicate: isNode,
|
|
15368
|
-
nodeCloneFn: cloneNode,
|
|
15369
|
-
...rest
|
|
15370
|
-
});
|
|
15371
|
-
};
|
|
15372
|
-
|
|
15373
|
-
// @ts-ignore
|
|
15374
|
-
visit[Symbol.for('nodejs.util.promisify.custom')] = async (root,
|
|
15375
|
-
// @ts-ignore
|
|
15376
|
-
visitor, {
|
|
15377
|
-
keyMap = keyMapDefault,
|
|
15378
|
-
...rest
|
|
15379
|
-
} = {}) => {
|
|
15380
|
-
// @ts-ignore
|
|
15381
|
-
return _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__.visit[Symbol.for('nodejs.util.promisify.custom')](root, visitor, {
|
|
15382
|
-
// @ts-ignore
|
|
15383
|
-
keyMap,
|
|
15384
|
-
// @ts-ignore
|
|
15385
|
-
nodeTypeGetter: getNodeType,
|
|
15386
|
-
nodePredicate: isNode,
|
|
15387
|
-
nodeCloneFn: cloneNode,
|
|
15388
|
-
...rest
|
|
15389
|
-
});
|
|
15390
|
-
};
|
|
15391
|
-
|
|
15392
|
-
/***/ }),
|
|
15393
|
-
|
|
15394
14485
|
/***/ 7345:
|
|
15395
14486
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
15396
14487
|
|