@speclynx/apidom-parser-adapter-json-schema-json-2020-12 2.13.0 → 3.0.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.
|
@@ -19888,7 +19888,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19888
19888
|
* @public
|
|
19889
19889
|
*/
|
|
19890
19890
|
const emptyElement = element => {
|
|
19891
|
-
const meta = !element.isMetaEmpty ?
|
|
19891
|
+
const meta = !element.isMetaEmpty ? element.meta.cloneDeep() : undefined;
|
|
19892
19892
|
const attributes = !element.isAttributesEmpty ? (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.attributes) : undefined;
|
|
19893
19893
|
|
|
19894
19894
|
// @ts-ignore
|
|
@@ -19904,7 +19904,7 @@ const getMergeFunction = (keyElement, options) => {
|
|
|
19904
19904
|
};
|
|
19905
19905
|
const getMetaMergeFunction = options => {
|
|
19906
19906
|
if (typeof options.customMetaMerge !== 'function') {
|
|
19907
|
-
return targetMeta =>
|
|
19907
|
+
return targetMeta => targetMeta.cloneDeep();
|
|
19908
19908
|
}
|
|
19909
19909
|
return options.customMetaMerge;
|
|
19910
19910
|
};
|
|
@@ -19976,8 +19976,20 @@ const deepmerge = (targetElement, sourceElement, options) => {
|
|
|
19976
19976
|
const mergedElement = sourceIsArrayElement && typeof mergedOptions.arrayElementMerge === 'function' ? mergedOptions.arrayElementMerge(targetElement, sourceElement, mergedOptions) : mergedOptions.objectElementMerge(targetElement, sourceElement, mergedOptions);
|
|
19977
19977
|
|
|
19978
19978
|
// merging meta & attributes
|
|
19979
|
-
|
|
19980
|
-
|
|
19979
|
+
if (!targetElement.isMetaEmpty && !sourceElement.isMetaEmpty) {
|
|
19980
|
+
mergedElement.meta = getMetaMergeFunction(mergedOptions)(targetElement.meta, sourceElement.meta);
|
|
19981
|
+
} else if (!targetElement.isMetaEmpty) {
|
|
19982
|
+
mergedElement.meta = targetElement.meta.cloneDeep();
|
|
19983
|
+
} else if (!sourceElement.isMetaEmpty) {
|
|
19984
|
+
mergedElement.meta = sourceElement.meta.cloneDeep();
|
|
19985
|
+
}
|
|
19986
|
+
if (!targetElement.isAttributesEmpty && !sourceElement.isAttributesEmpty) {
|
|
19987
|
+
mergedElement.attributes = getAttributesMergeFunction(mergedOptions)(targetElement.attributes, sourceElement.attributes);
|
|
19988
|
+
} else if (!targetElement.isAttributesEmpty) {
|
|
19989
|
+
mergedElement.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(targetElement.attributes);
|
|
19990
|
+
} else if (!sourceElement.isAttributesEmpty) {
|
|
19991
|
+
mergedElement.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(sourceElement.attributes);
|
|
19992
|
+
}
|
|
19981
19993
|
return mergedElement;
|
|
19982
19994
|
};
|
|
19983
19995
|
deepmerge.all = (list, options) => {
|
|
@@ -20316,6 +20328,105 @@ class KeyValuePair {
|
|
|
20316
20328
|
|
|
20317
20329
|
/***/ },
|
|
20318
20330
|
|
|
20331
|
+
/***/ 1844
|
|
20332
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
20333
|
+
|
|
20334
|
+
"use strict";
|
|
20335
|
+
__webpack_require__.r(__webpack_exports__);
|
|
20336
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20337
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
20338
|
+
/* harmony export */ });
|
|
20339
|
+
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
|
|
20340
|
+
|
|
20341
|
+
/**
|
|
20342
|
+
* Lightweight meta container for Element metadata.
|
|
20343
|
+
*
|
|
20344
|
+
* Data is stored as own properties on the instance; methods live on the prototype.
|
|
20345
|
+
* `Object.keys()`, `Object.entries()`, etc. only see data properties.
|
|
20346
|
+
*
|
|
20347
|
+
* @public
|
|
20348
|
+
*/
|
|
20349
|
+
class Metadata {
|
|
20350
|
+
// Set via prototype assignment in registration.ts to avoid circular dependency
|
|
20351
|
+
|
|
20352
|
+
get(name) {
|
|
20353
|
+
return this[name];
|
|
20354
|
+
}
|
|
20355
|
+
set(name, value) {
|
|
20356
|
+
this[name] = value;
|
|
20357
|
+
}
|
|
20358
|
+
hasKey(name) {
|
|
20359
|
+
return Object.hasOwn(this, name);
|
|
20360
|
+
}
|
|
20361
|
+
keys() {
|
|
20362
|
+
return Object.keys(this);
|
|
20363
|
+
}
|
|
20364
|
+
remove(name) {
|
|
20365
|
+
delete this[name];
|
|
20366
|
+
}
|
|
20367
|
+
get isEmpty() {
|
|
20368
|
+
return Object.keys(this).length === 0;
|
|
20369
|
+
}
|
|
20370
|
+
get isFrozen() {
|
|
20371
|
+
return Object.isFrozen(this);
|
|
20372
|
+
}
|
|
20373
|
+
freeze() {
|
|
20374
|
+
for (const value of Object.values(this)) {
|
|
20375
|
+
if (value instanceof this.Element) {
|
|
20376
|
+
value.freeze();
|
|
20377
|
+
} else if (Array.isArray(value) || value !== null && typeof value === 'object') {
|
|
20378
|
+
Object.freeze(value);
|
|
20379
|
+
}
|
|
20380
|
+
}
|
|
20381
|
+
Object.freeze(this);
|
|
20382
|
+
}
|
|
20383
|
+
|
|
20384
|
+
/**
|
|
20385
|
+
* Creates a shallow clone. Same references, new container.
|
|
20386
|
+
*/
|
|
20387
|
+
cloneShallow() {
|
|
20388
|
+
const clone = new Metadata();
|
|
20389
|
+
Object.assign(clone, this);
|
|
20390
|
+
return clone;
|
|
20391
|
+
}
|
|
20392
|
+
|
|
20393
|
+
/**
|
|
20394
|
+
* Merges another Metadata into a new instance.
|
|
20395
|
+
* Arrays are concatenated, all other values are overwritten by source.
|
|
20396
|
+
*/
|
|
20397
|
+
merge(source) {
|
|
20398
|
+
const result = this.cloneShallow();
|
|
20399
|
+
for (const [key, value] of Object.entries(source)) {
|
|
20400
|
+
const existing = result.get(key);
|
|
20401
|
+
if (Array.isArray(existing) && Array.isArray(value)) {
|
|
20402
|
+
result.set(key, [...existing, ...value]);
|
|
20403
|
+
} else {
|
|
20404
|
+
result.set(key, value);
|
|
20405
|
+
}
|
|
20406
|
+
}
|
|
20407
|
+
return result;
|
|
20408
|
+
}
|
|
20409
|
+
|
|
20410
|
+
/**
|
|
20411
|
+
* Creates a deep clone. Elements are deep cloned,
|
|
20412
|
+
* all other values are deep cloned via ramda clone.
|
|
20413
|
+
*/
|
|
20414
|
+
cloneDeep() {
|
|
20415
|
+
const copy = new Metadata();
|
|
20416
|
+
for (const [key, value] of Object.entries(this)) {
|
|
20417
|
+
if (value instanceof this.Element) {
|
|
20418
|
+
copy.set(key, this.cloneDeepElement(value));
|
|
20419
|
+
} else {
|
|
20420
|
+
copy.set(key, (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(value));
|
|
20421
|
+
}
|
|
20422
|
+
}
|
|
20423
|
+
return copy;
|
|
20424
|
+
}
|
|
20425
|
+
}
|
|
20426
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Metadata);
|
|
20427
|
+
|
|
20428
|
+
/***/ },
|
|
20429
|
+
|
|
20319
20430
|
/***/ 5156
|
|
20320
20431
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
20321
20432
|
|
|
@@ -20962,7 +21073,7 @@ const cloneShallowElement = element => {
|
|
|
20962
21073
|
const copy = new Ctor();
|
|
20963
21074
|
copy.element = element.element;
|
|
20964
21075
|
if (!element.isMetaEmpty) {
|
|
20965
|
-
copy.meta =
|
|
21076
|
+
copy.meta = element.meta.cloneDeep();
|
|
20966
21077
|
}
|
|
20967
21078
|
if (!element.isAttributesEmpty) {
|
|
20968
21079
|
copy.attributes = cloneDeep(element.attributes);
|
|
@@ -20990,8 +21101,8 @@ const cloneShallowElement = element => {
|
|
|
20990
21101
|
|
|
20991
21102
|
/**
|
|
20992
21103
|
* Creates a shallow clone of an ApiDOM Element, KeyValuePair, or ObjectSlice.
|
|
20993
|
-
* The element itself is cloned, but content references are shared
|
|
20994
|
-
*
|
|
21104
|
+
* The element itself is cloned, but content references are shared.
|
|
21105
|
+
* Meta and attributes are deep cloned to preserve semantic information.
|
|
20995
21106
|
* @public
|
|
20996
21107
|
*/
|
|
20997
21108
|
const cloneShallow = value => {
|
|
@@ -22066,7 +22177,7 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
22066
22177
|
* Search the tree recursively and find the element with the matching ID.
|
|
22067
22178
|
*/
|
|
22068
22179
|
getById(id) {
|
|
22069
|
-
return this.find(item => item.id
|
|
22180
|
+
return this.find(item => item.id === id).first;
|
|
22070
22181
|
}
|
|
22071
22182
|
|
|
22072
22183
|
/**
|
|
@@ -22096,18 +22207,24 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
22096
22207
|
"use strict";
|
|
22097
22208
|
__webpack_require__.r(__webpack_exports__);
|
|
22098
22209
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
22210
|
+
/* harmony export */ Metadata: () => (/* reexport safe */ _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]),
|
|
22099
22211
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
22100
22212
|
/* harmony export */ });
|
|
22101
22213
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3654);
|
|
22102
|
-
/* harmony import */ var
|
|
22103
|
-
/* harmony import */ var
|
|
22214
|
+
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1844);
|
|
22215
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6663);
|
|
22216
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8504);
|
|
22217
|
+
|
|
22104
22218
|
|
|
22105
22219
|
|
|
22220
|
+
// shared singleton for frozen elements with no meta — avoids allocation on every access
|
|
22221
|
+
const FROZEN_EMPTY_METADATA = Object.freeze(new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]());
|
|
22106
22222
|
|
|
22107
22223
|
/**
|
|
22108
22224
|
* Valid content types for an Element.
|
|
22109
22225
|
* @public
|
|
22110
22226
|
*/
|
|
22227
|
+
|
|
22111
22228
|
/**
|
|
22112
22229
|
* Base Element class that all ApiDOM elements extend.
|
|
22113
22230
|
*
|
|
@@ -22205,7 +22322,7 @@ class Element {
|
|
|
22205
22322
|
_attributes;
|
|
22206
22323
|
|
|
22207
22324
|
// ============================================================
|
|
22208
|
-
// Prototype-assigned properties (set in
|
|
22325
|
+
// Prototype-assigned properties (set in registration.ts)
|
|
22209
22326
|
// Using 'declare' allows TypeScript to know about these
|
|
22210
22327
|
// without generating runtime code.
|
|
22211
22328
|
// ============================================================
|
|
@@ -22266,13 +22383,13 @@ class Element {
|
|
|
22266
22383
|
}
|
|
22267
22384
|
|
|
22268
22385
|
// KeyValuePair
|
|
22269
|
-
if (value instanceof
|
|
22386
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
22270
22387
|
this._content = value;
|
|
22271
22388
|
return;
|
|
22272
22389
|
}
|
|
22273
22390
|
|
|
22274
22391
|
// ObjectSlice - extract elements array
|
|
22275
|
-
if (value instanceof
|
|
22392
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
22276
22393
|
this._content = value.elements;
|
|
22277
22394
|
return;
|
|
22278
22395
|
}
|
|
@@ -22293,24 +22410,22 @@ class Element {
|
|
|
22293
22410
|
|
|
22294
22411
|
/**
|
|
22295
22412
|
* Metadata about this element (id, classes, title, description, links).
|
|
22296
|
-
* Lazily creates
|
|
22413
|
+
* Lazily creates a Metadata instance if not set.
|
|
22297
22414
|
*/
|
|
22298
22415
|
get meta() {
|
|
22299
22416
|
if (!this._meta) {
|
|
22300
|
-
if (this.isFrozen)
|
|
22301
|
-
|
|
22302
|
-
meta.freeze();
|
|
22303
|
-
return meta;
|
|
22304
|
-
}
|
|
22305
|
-
this._meta = new this.ObjectElement();
|
|
22417
|
+
if (this.isFrozen) return FROZEN_EMPTY_METADATA;
|
|
22418
|
+
this._meta = new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
22306
22419
|
}
|
|
22307
22420
|
return this._meta;
|
|
22308
22421
|
}
|
|
22309
22422
|
set meta(value) {
|
|
22310
|
-
if (value instanceof
|
|
22423
|
+
if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
22311
22424
|
this._meta = value;
|
|
22312
|
-
} else {
|
|
22313
|
-
|
|
22425
|
+
} else if (value && typeof value === 'object') {
|
|
22426
|
+
const meta = new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
22427
|
+
Object.assign(meta, value);
|
|
22428
|
+
this._meta = meta;
|
|
22314
22429
|
}
|
|
22315
22430
|
}
|
|
22316
22431
|
|
|
@@ -22343,10 +22458,8 @@ class Element {
|
|
|
22343
22458
|
|
|
22344
22459
|
/** Unique identifier for this element. */
|
|
22345
22460
|
get id() {
|
|
22346
|
-
if (this.isFrozen) {
|
|
22347
|
-
return this.getMetaProperty('id', '');
|
|
22348
|
-
}
|
|
22349
22461
|
if (!this.hasMetaProperty('id')) {
|
|
22462
|
+
if (this.isFrozen) return '';
|
|
22350
22463
|
this.setMetaProperty('id', '');
|
|
22351
22464
|
}
|
|
22352
22465
|
return this.meta.get('id');
|
|
@@ -22357,10 +22470,8 @@ class Element {
|
|
|
22357
22470
|
|
|
22358
22471
|
/** CSS-like class names. */
|
|
22359
22472
|
get classes() {
|
|
22360
|
-
if (this.isFrozen) {
|
|
22361
|
-
return this.getMetaProperty('classes', []);
|
|
22362
|
-
}
|
|
22363
22473
|
if (!this.hasMetaProperty('classes')) {
|
|
22474
|
+
if (this.isFrozen) return [];
|
|
22364
22475
|
this.setMetaProperty('classes', []);
|
|
22365
22476
|
}
|
|
22366
22477
|
return this.meta.get('classes');
|
|
@@ -22371,11 +22482,13 @@ class Element {
|
|
|
22371
22482
|
|
|
22372
22483
|
/** Hyperlinks associated with this element. */
|
|
22373
22484
|
get links() {
|
|
22374
|
-
if (this.isFrozen) {
|
|
22375
|
-
return this.getMetaProperty('links', []);
|
|
22376
|
-
}
|
|
22377
22485
|
if (!this.hasMetaProperty('links')) {
|
|
22378
|
-
this.
|
|
22486
|
+
if (this.isFrozen) {
|
|
22487
|
+
const empty = new this.ArrayElement();
|
|
22488
|
+
empty.freeze();
|
|
22489
|
+
return empty;
|
|
22490
|
+
}
|
|
22491
|
+
this.setMetaProperty('links', new this.ArrayElement());
|
|
22379
22492
|
}
|
|
22380
22493
|
return this.meta.get('links');
|
|
22381
22494
|
}
|
|
@@ -22395,7 +22508,7 @@ class Element {
|
|
|
22395
22508
|
if (Array.isArray(content)) {
|
|
22396
22509
|
return content;
|
|
22397
22510
|
}
|
|
22398
|
-
if (content instanceof
|
|
22511
|
+
if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
22399
22512
|
const children = [];
|
|
22400
22513
|
if (content.key) children.push(content.key);
|
|
22401
22514
|
if (content.value) children.push(content.value);
|
|
@@ -22425,7 +22538,6 @@ class Element {
|
|
|
22425
22538
|
|
|
22426
22539
|
// Freeze meta and attributes
|
|
22427
22540
|
if (this._meta) {
|
|
22428
|
-
this._meta.parent = this;
|
|
22429
22541
|
this._meta.freeze();
|
|
22430
22542
|
}
|
|
22431
22543
|
if (this._attributes) {
|
|
@@ -22460,7 +22572,7 @@ class Element {
|
|
|
22460
22572
|
if (_content instanceof Element) {
|
|
22461
22573
|
return _content.toValue();
|
|
22462
22574
|
}
|
|
22463
|
-
if (_content instanceof
|
|
22575
|
+
if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
22464
22576
|
return _content.toValue();
|
|
22465
22577
|
}
|
|
22466
22578
|
if (Array.isArray(_content)) {
|
|
@@ -22516,7 +22628,7 @@ class Element {
|
|
|
22516
22628
|
* @throws Error if this element has no ID
|
|
22517
22629
|
*/
|
|
22518
22630
|
toRef(path) {
|
|
22519
|
-
const idValue = this.id
|
|
22631
|
+
const idValue = this.id;
|
|
22520
22632
|
if (idValue === '') {
|
|
22521
22633
|
throw new Error('Cannot create reference to an element without an ID');
|
|
22522
22634
|
}
|
|
@@ -22528,26 +22640,16 @@ class Element {
|
|
|
22528
22640
|
}
|
|
22529
22641
|
|
|
22530
22642
|
/**
|
|
22531
|
-
* Gets a meta property.
|
|
22643
|
+
* Gets a meta property value.
|
|
22532
22644
|
*
|
|
22533
22645
|
* When the property doesn't exist:
|
|
22534
|
-
* - With defaultValue: returns
|
|
22646
|
+
* - With defaultValue: returns the provided default value
|
|
22535
22647
|
* - Without defaultValue: returns undefined
|
|
22536
|
-
*
|
|
22537
|
-
* Note: Each call with a default creates a new instance. Use setMetaProperty
|
|
22538
|
-
* first if you need reference equality across multiple accesses.
|
|
22539
22648
|
*/
|
|
22540
22649
|
|
|
22541
22650
|
getMetaProperty(name, defaultValue) {
|
|
22542
22651
|
if (!this.hasMetaProperty(name)) {
|
|
22543
|
-
|
|
22544
|
-
return undefined;
|
|
22545
|
-
}
|
|
22546
|
-
const element = this.refract(defaultValue);
|
|
22547
|
-
if (element && this.isFrozen) {
|
|
22548
|
-
element.freeze();
|
|
22549
|
-
}
|
|
22550
|
-
return element;
|
|
22652
|
+
return defaultValue;
|
|
22551
22653
|
}
|
|
22552
22654
|
return this.meta.get(name);
|
|
22553
22655
|
}
|
|
@@ -22560,20 +22662,17 @@ class Element {
|
|
|
22560
22662
|
}
|
|
22561
22663
|
|
|
22562
22664
|
/**
|
|
22563
|
-
*
|
|
22665
|
+
* Checks whether a meta property exists.
|
|
22564
22666
|
*/
|
|
22565
22667
|
hasMetaProperty(name) {
|
|
22566
|
-
|
|
22567
|
-
return this.meta.hasKey(name);
|
|
22568
|
-
}
|
|
22569
|
-
return false;
|
|
22668
|
+
return this._meta !== undefined && this._meta.hasKey(name);
|
|
22570
22669
|
}
|
|
22571
22670
|
|
|
22572
22671
|
/**
|
|
22573
22672
|
* Checks if meta is empty.
|
|
22574
22673
|
*/
|
|
22575
22674
|
get isMetaEmpty() {
|
|
22576
|
-
return this._meta === undefined || this.
|
|
22675
|
+
return this._meta === undefined || this._meta.isEmpty;
|
|
22577
22676
|
}
|
|
22578
22677
|
|
|
22579
22678
|
/**
|
|
@@ -22599,7 +22698,7 @@ class Element {
|
|
|
22599
22698
|
}
|
|
22600
22699
|
|
|
22601
22700
|
/**
|
|
22602
|
-
*
|
|
22701
|
+
* Checks whether an attributes property exists.
|
|
22603
22702
|
*/
|
|
22604
22703
|
hasAttributesProperty(name) {
|
|
22605
22704
|
if (!this.isAttributesEmpty) {
|
|
@@ -22618,6 +22717,7 @@ class Element {
|
|
|
22618
22717
|
|
|
22619
22718
|
// Re-export types for convenience
|
|
22620
22719
|
|
|
22720
|
+
|
|
22621
22721
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Element);
|
|
22622
22722
|
|
|
22623
22723
|
/***/ },
|
|
@@ -23056,6 +23156,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23056
23156
|
/* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(9686);
|
|
23057
23157
|
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(8504);
|
|
23058
23158
|
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(6663);
|
|
23159
|
+
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(1844);
|
|
23160
|
+
/* harmony import */ var _clone_index_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(2111);
|
|
23161
|
+
|
|
23162
|
+
|
|
23059
23163
|
|
|
23060
23164
|
|
|
23061
23165
|
|
|
@@ -23115,14 +23219,16 @@ function refract(value) {
|
|
|
23115
23219
|
}
|
|
23116
23220
|
|
|
23117
23221
|
// Set up prototype assignments for circular dependency resolution.
|
|
23118
|
-
// These allow Element instances to
|
|
23119
|
-
//
|
|
23222
|
+
// These allow Element and Metadata instances to reference classes they can't import
|
|
23223
|
+
// directly (which would cause circular imports).
|
|
23120
23224
|
// Using 'declare' in the class definitions enables type-safe access to these properties.
|
|
23121
23225
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ObjectElement = _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_8__["default"];
|
|
23122
23226
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ArrayElement = _primitives_ArrayElement_mjs__WEBPACK_IMPORTED_MODULE_6__["default"];
|
|
23123
23227
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.RefElement = _elements_RefElement_mjs__WEBPACK_IMPORTED_MODULE_10__["default"];
|
|
23124
23228
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.MemberElement = _primitives_MemberElement_mjs__WEBPACK_IMPORTED_MODULE_7__["default"];
|
|
23125
23229
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.refract = refract;
|
|
23230
|
+
_Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__["default"].prototype.Element = _primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
23231
|
+
_Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__["default"].prototype.cloneDeepElement = element => (0,_clone_index_mjs__WEBPACK_IMPORTED_MODULE_19__.cloneDeep)(element);
|
|
23126
23232
|
|
|
23127
23233
|
/**
|
|
23128
23234
|
* Contains all of the element classes, and related structures and methods
|
|
@@ -23187,7 +23293,13 @@ class JSONSerialiser {
|
|
|
23187
23293
|
element: element.element
|
|
23188
23294
|
};
|
|
23189
23295
|
if (!element.isMetaEmpty) {
|
|
23190
|
-
|
|
23296
|
+
const serialisedMeta = this.serialiseMeta(element);
|
|
23297
|
+
if (serialisedMeta) {
|
|
23298
|
+
payload.meta = serialisedMeta.meta;
|
|
23299
|
+
if (serialisedMeta.rawKeys.length > 0) {
|
|
23300
|
+
payload.__meta_raw__ = serialisedMeta.rawKeys;
|
|
23301
|
+
}
|
|
23302
|
+
}
|
|
23191
23303
|
}
|
|
23192
23304
|
if (!element.isAttributesEmpty) {
|
|
23193
23305
|
payload.attributes = this.serialiseObject(element.attributes);
|
|
@@ -23234,7 +23346,7 @@ class JSONSerialiser {
|
|
|
23234
23346
|
element.element = value.element;
|
|
23235
23347
|
}
|
|
23236
23348
|
|
|
23237
|
-
// Extract
|
|
23349
|
+
// Extract special meta keys without mutating input, filter remaining meta
|
|
23238
23350
|
let mappingsDoc;
|
|
23239
23351
|
let stylesDoc;
|
|
23240
23352
|
let metaToDeserialize = value.meta;
|
|
@@ -23248,8 +23360,15 @@ class JSONSerialiser {
|
|
|
23248
23360
|
stylesDoc = __styles__;
|
|
23249
23361
|
metaToDeserialize = Object.keys(rest).length > 0 ? rest : undefined;
|
|
23250
23362
|
}
|
|
23363
|
+
|
|
23364
|
+
// determine which meta keys were raw primitives before serialization
|
|
23365
|
+
const rawKeys = value.__meta_raw__ ? new Set(value.__meta_raw__) : undefined;
|
|
23251
23366
|
if (metaToDeserialize) {
|
|
23252
|
-
|
|
23367
|
+
for (const [key, doc] of Object.entries(metaToDeserialize)) {
|
|
23368
|
+
const deserialized = this.deserialise(doc);
|
|
23369
|
+
// unwrap keys that were raw primitives before serialization
|
|
23370
|
+
element.setMetaProperty(key, rawKeys?.has(key) ? deserialized.toValue() : deserialized);
|
|
23371
|
+
}
|
|
23253
23372
|
}
|
|
23254
23373
|
|
|
23255
23374
|
// Restore source position from __mappings__
|
|
@@ -23312,6 +23431,27 @@ class JSONSerialiser {
|
|
|
23312
23431
|
}
|
|
23313
23432
|
return content;
|
|
23314
23433
|
}
|
|
23434
|
+
serialiseMeta(element) {
|
|
23435
|
+
const meta = {};
|
|
23436
|
+
const rawKeys = [];
|
|
23437
|
+
let hasEntries = false;
|
|
23438
|
+
for (const [key, value] of Object.entries(element.meta)) {
|
|
23439
|
+
if (value instanceof this.namespace.elements.Element) {
|
|
23440
|
+
meta[key] = this.serialise(value);
|
|
23441
|
+
hasEntries = true;
|
|
23442
|
+
} else if (value !== undefined) {
|
|
23443
|
+
// refract primitives to maintain JSON Refract spec compatibility
|
|
23444
|
+
const refracted = element.refract(value);
|
|
23445
|
+
meta[key] = this.serialise(refracted);
|
|
23446
|
+
rawKeys.push(key);
|
|
23447
|
+
hasEntries = true;
|
|
23448
|
+
}
|
|
23449
|
+
}
|
|
23450
|
+
return hasEntries ? {
|
|
23451
|
+
meta,
|
|
23452
|
+
rawKeys
|
|
23453
|
+
} : undefined;
|
|
23454
|
+
}
|
|
23315
23455
|
serialiseObject(obj) {
|
|
23316
23456
|
const result = {};
|
|
23317
23457
|
obj.forEach((value, key) => {
|
|
@@ -24568,7 +24708,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24568
24708
|
const refract = (value, {
|
|
24569
24709
|
element = 'jSONSchema202012',
|
|
24570
24710
|
plugins = [],
|
|
24571
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
24711
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
24712
|
+
consume = false
|
|
24572
24713
|
} = {}) => {
|
|
24573
24714
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.refract)(value);
|
|
24574
24715
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__.resolveSpecification)(specificationObj);
|
|
@@ -24585,7 +24726,8 @@ const refract = (value, {
|
|
|
24585
24726
|
*/
|
|
24586
24727
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
24587
24728
|
const rootVisitor = new RootVisitorClass({
|
|
24588
|
-
specObj: resolvedSpec
|
|
24729
|
+
specObj: resolvedSpec,
|
|
24730
|
+
consume
|
|
24589
24731
|
});
|
|
24590
24732
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__.traverse)(genericElement, rootVisitor);
|
|
24591
24733
|
|
|
@@ -25600,7 +25742,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25600
25742
|
*/
|
|
25601
25743
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
25602
25744
|
enter(path) {
|
|
25603
|
-
this.element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
25745
|
+
this.element = this.consume ? path.node : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
25604
25746
|
path.stop();
|
|
25605
25747
|
}
|
|
25606
25748
|
}
|
|
@@ -25640,7 +25782,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25640
25782
|
*/
|
|
25641
25783
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
25642
25784
|
specObj;
|
|
25643
|
-
passingOptionsNames = ['specObj', 'parent'];
|
|
25785
|
+
passingOptionsNames = ['specObj', 'parent', 'consume'];
|
|
25644
25786
|
constructor({
|
|
25645
25787
|
specObj,
|
|
25646
25788
|
...rest
|
|
@@ -25686,7 +25828,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
25686
25828
|
*/
|
|
25687
25829
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
25688
25830
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
25689
|
-
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
25831
|
+
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
25690
25832
|
}
|
|
25691
25833
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
25692
25834
|
return visitor.element;
|
|
@@ -25705,7 +25847,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25705
25847
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
25706
25848
|
/* harmony export */ });
|
|
25707
25849
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8400);
|
|
25708
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
25850
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2111);
|
|
25709
25851
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5810);
|
|
25710
25852
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9686);
|
|
25711
25853
|
|
|
@@ -25720,19 +25862,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25720
25862
|
*/
|
|
25721
25863
|
class Visitor {
|
|
25722
25864
|
element;
|
|
25865
|
+
consume = false;
|
|
25866
|
+
consumeSafe = false;
|
|
25723
25867
|
constructor(options) {
|
|
25724
25868
|
Object.assign(this, options);
|
|
25725
25869
|
}
|
|
25726
25870
|
copyMetaAndAttributes(from, to) {
|
|
25727
|
-
if (!from.isMetaEmpty
|
|
25728
|
-
|
|
25729
|
-
|
|
25730
|
-
to.meta = (
|
|
25871
|
+
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
25872
|
+
to.meta = to.meta.merge(from.meta);
|
|
25873
|
+
} else if (!from.isMetaEmpty) {
|
|
25874
|
+
to.meta = from.meta.cloneDeep();
|
|
25731
25875
|
}
|
|
25732
|
-
if (!from.isAttributesEmpty
|
|
25733
|
-
|
|
25734
|
-
|
|
25735
|
-
to.attributes = (0,
|
|
25876
|
+
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
25877
|
+
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
25878
|
+
} else if (!from.isAttributesEmpty) {
|
|
25879
|
+
to.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.attributes);
|
|
25736
25880
|
}
|
|
25737
25881
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
25738
25882
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -25842,12 +25986,13 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
25842
25986
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
25843
25987
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
25844
25988
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
25845
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
25989
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
25846
25990
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
25847
|
-
newMemberElement.classes.push('fixed-field');
|
|
25848
25991
|
this.element.content.push(newMemberElement);
|
|
25992
|
+
// consume: release processed generic subtree
|
|
25993
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
25849
25994
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
25850
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
25995
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
25851
25996
|
}
|
|
25852
25997
|
});
|
|
25853
25998
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -25936,12 +26081,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
25936
26081
|
if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
25937
26082
|
const specPath = this.specPath(value);
|
|
25938
26083
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
25939
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
26084
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
25940
26085
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
25941
26086
|
newMemberElement.classes.push('patterned-field');
|
|
25942
26087
|
this.element.content.push(newMemberElement);
|
|
26088
|
+
// consume: release processed generic subtree
|
|
26089
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
25943
26090
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
25944
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
26091
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
25945
26092
|
}
|
|
25946
26093
|
});
|
|
25947
26094
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -26499,13 +26646,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26499
26646
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3031);
|
|
26500
26647
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6513);
|
|
26501
26648
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5162);
|
|
26502
|
-
/* harmony import */ var
|
|
26503
|
-
/* harmony import */ var
|
|
26504
|
-
/* harmony import */ var
|
|
26505
|
-
/* harmony import */ var
|
|
26506
|
-
/* harmony import */ var
|
|
26507
|
-
/* harmony import */ var _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4686);
|
|
26508
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(6059);
|
|
26649
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4673);
|
|
26650
|
+
/* harmony import */ var _generics_FixedFieldsVisitor_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5320);
|
|
26651
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9033);
|
|
26652
|
+
/* harmony import */ var _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4686);
|
|
26653
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6059);
|
|
26509
26654
|
|
|
26510
26655
|
|
|
26511
26656
|
|
|
@@ -26520,10 +26665,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26520
26665
|
/**
|
|
26521
26666
|
* @public
|
|
26522
26667
|
*/
|
|
26523
|
-
class JSONSchemaVisitor extends
|
|
26668
|
+
class JSONSchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_7__.JSONSchemaVisitorBase {
|
|
26524
26669
|
constructor(options) {
|
|
26525
26670
|
super(options);
|
|
26526
|
-
this.element = new
|
|
26671
|
+
this.element = new _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]();
|
|
26672
|
+
this.consumeSafe = true;
|
|
26527
26673
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'JSONSchema']);
|
|
26528
26674
|
}
|
|
26529
26675
|
get defaultDialectIdentifier() {
|
|
@@ -26536,27 +26682,27 @@ class JSONSchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_9__.JSONSche
|
|
|
26536
26682
|
|
|
26537
26683
|
// for further processing consider this JSONSchema Element as parent for all sub-schemas
|
|
26538
26684
|
this.parent = this.element;
|
|
26539
|
-
return
|
|
26685
|
+
return _generics_FixedFieldsVisitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"].prototype.ObjectElement.call(this, path);
|
|
26540
26686
|
}
|
|
26541
26687
|
handleDialectIdentifier(objectElement) {
|
|
26542
26688
|
// handle $schema keyword in embedded resources
|
|
26543
26689
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(this.parent) && !(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.isStringElement)(objectElement.get('$schema'))) {
|
|
26544
26690
|
// no parent available and no $schema is defined, set default $schema
|
|
26545
26691
|
this.element.meta.set('inheritedDialectIdentifier', this.defaultDialectIdentifier);
|
|
26546
|
-
} else if ((0,
|
|
26692
|
+
} else if ((0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_9__.isJSONSchemaElement)(this.parent) && !(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.isStringElement)(objectElement.get('$schema'))) {
|
|
26547
26693
|
// parent is available and no $schema is defined, set parent $schema
|
|
26548
|
-
const inheritedDialectIdentifier = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(
|
|
26694
|
+
const inheritedDialectIdentifier = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(this.parent.meta.get('inheritedDialectIdentifier'), (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(this.parent.$schema));
|
|
26549
26695
|
this.element.meta.set('inheritedDialectIdentifier', inheritedDialectIdentifier);
|
|
26550
26696
|
}
|
|
26551
26697
|
}
|
|
26552
26698
|
handleSchemaIdentifier(objectElement, identifierKeyword = 'id') {
|
|
26553
26699
|
// handle schema identifier in embedded resources
|
|
26554
|
-
// fetch parent's ancestorsSchemaIdentifiers
|
|
26555
|
-
const ancestorsSchemaIdentifiers = this.parent !== undefined ? (
|
|
26700
|
+
// fetch parent's ancestorsSchemaIdentifiers (stored as plain string[])
|
|
26701
|
+
const ancestorsSchemaIdentifiers = this.parent !== undefined ? [...(this.parent.meta.get('ancestorsSchemaIdentifiers') ?? [])] : [];
|
|
26556
26702
|
// get current schema identifier
|
|
26557
|
-
const schemaIdentifier = (0,
|
|
26703
|
+
const schemaIdentifier = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(objectElement.get(identifierKeyword));
|
|
26558
26704
|
|
|
26559
|
-
// remember schema identifier if it's a non-empty
|
|
26705
|
+
// remember schema identifier if it's a non-empty string
|
|
26560
26706
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_3__["default"])(schemaIdentifier)) {
|
|
26561
26707
|
ancestorsSchemaIdentifiers.push(schemaIdentifier);
|
|
26562
26708
|
}
|
|
@@ -27718,8 +27864,9 @@ const parse = async source => {
|
|
|
27718
27864
|
if (source.trim().length === 0) {
|
|
27719
27865
|
return parseResult;
|
|
27720
27866
|
}
|
|
27721
|
-
|
|
27867
|
+
let pojo = JSON.parse(source);
|
|
27722
27868
|
const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.refract)(pojo);
|
|
27869
|
+
pojo = null; // allow GC to reclaim POJO
|
|
27723
27870
|
element.classes.push('result');
|
|
27724
27871
|
parseResult.push(element);
|
|
27725
27872
|
return parseResult;
|
|
@@ -29693,7 +29840,10 @@ const parse = async (source, options = {}) => {
|
|
|
29693
29840
|
result
|
|
29694
29841
|
} = parseResultElement;
|
|
29695
29842
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
29696
|
-
const jsonSchemaElement = (0,_speclynx_apidom_ns_json_schema_2020_12__WEBPACK_IMPORTED_MODULE_6__.refractJSONSchema)(result,
|
|
29843
|
+
const jsonSchemaElement = (0,_speclynx_apidom_ns_json_schema_2020_12__WEBPACK_IMPORTED_MODULE_6__.refractJSONSchema)(result, {
|
|
29844
|
+
consume: true,
|
|
29845
|
+
...refractorOpts
|
|
29846
|
+
});
|
|
29697
29847
|
jsonSchemaElement.classes.push('result');
|
|
29698
29848
|
parseResultElement.replaceResult(jsonSchemaElement);
|
|
29699
29849
|
}
|