@speclynx/apidom-datamodel 4.12.0 → 4.13.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
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [4.13.0](https://github.com/speclynx/apidom/compare/v4.12.1...v4.13.0) (2026-06-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @speclynx/apidom-datamodel
|
|
9
|
+
|
|
10
|
+
## [4.12.1](https://github.com/speclynx/apidom/compare/v4.12.0...v4.12.1) (2026-06-23)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **datamodel:** register annotation, comment and parseResult elements ([#356](https://github.com/speclynx/apidom/issues/356)) ([d6609ea](https://github.com/speclynx/apidom/commit/d6609ea2ffa5d550b0e3d528de79f7667fa41f21))
|
|
15
|
+
|
|
6
16
|
# [4.12.0](https://github.com/speclynx/apidom/compare/v4.11.1...v4.12.0) (2026-06-23)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @speclynx/apidom-datamodel
|
|
@@ -165,8 +165,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
165
165
|
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(975);
|
|
166
166
|
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(885);
|
|
167
167
|
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(474);
|
|
168
|
-
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
|
|
169
|
-
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
|
|
168
|
+
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24);
|
|
169
|
+
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(176);
|
|
170
|
+
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(755);
|
|
171
|
+
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(588);
|
|
172
|
+
/* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(807);
|
|
170
173
|
|
|
171
174
|
|
|
172
175
|
const isNull = value => value === null;
|
|
@@ -226,7 +229,7 @@ class Namespace {
|
|
|
226
229
|
_attributeElementArrayKeys = [];
|
|
227
230
|
constructor(options) {
|
|
228
231
|
this.Element = _registration_ts__WEBPACK_IMPORTED_MODULE_1__["default"];
|
|
229
|
-
this.KeyValuePair =
|
|
232
|
+
this.KeyValuePair = _registration_ts__WEBPACK_IMPORTED_MODULE_15__["default"];
|
|
230
233
|
if (!options || !options.noDefault) {
|
|
231
234
|
this.useDefault();
|
|
232
235
|
}
|
|
@@ -255,7 +258,7 @@ class Namespace {
|
|
|
255
258
|
*/
|
|
256
259
|
useDefault() {
|
|
257
260
|
// Set up classes for default elements
|
|
258
|
-
this.register('null', _registration_ts__WEBPACK_IMPORTED_MODULE_2__["default"]).register('string', _registration_ts__WEBPACK_IMPORTED_MODULE_3__["default"]).register('number', _registration_ts__WEBPACK_IMPORTED_MODULE_4__["default"]).register('boolean', _registration_ts__WEBPACK_IMPORTED_MODULE_5__["default"]).register('array', _registration_ts__WEBPACK_IMPORTED_MODULE_6__["default"]).register('object', _registration_ts__WEBPACK_IMPORTED_MODULE_8__["default"]).register('member', _registration_ts__WEBPACK_IMPORTED_MODULE_7__["default"]).register('ref', _registration_ts__WEBPACK_IMPORTED_MODULE_10__["default"]).register('link', _registration_ts__WEBPACK_IMPORTED_MODULE_9__["default"]).register('sourceMap', _registration_ts__WEBPACK_IMPORTED_MODULE_11__["default"]);
|
|
261
|
+
this.register('null', _registration_ts__WEBPACK_IMPORTED_MODULE_2__["default"]).register('string', _registration_ts__WEBPACK_IMPORTED_MODULE_3__["default"]).register('number', _registration_ts__WEBPACK_IMPORTED_MODULE_4__["default"]).register('boolean', _registration_ts__WEBPACK_IMPORTED_MODULE_5__["default"]).register('array', _registration_ts__WEBPACK_IMPORTED_MODULE_6__["default"]).register('object', _registration_ts__WEBPACK_IMPORTED_MODULE_8__["default"]).register('member', _registration_ts__WEBPACK_IMPORTED_MODULE_7__["default"]).register('ref', _registration_ts__WEBPACK_IMPORTED_MODULE_10__["default"]).register('link', _registration_ts__WEBPACK_IMPORTED_MODULE_9__["default"]).register('sourceMap', _registration_ts__WEBPACK_IMPORTED_MODULE_14__["default"]).register('annotation', _registration_ts__WEBPACK_IMPORTED_MODULE_11__["default"]).register('comment', _registration_ts__WEBPACK_IMPORTED_MODULE_12__["default"]).register('parseResult', _registration_ts__WEBPACK_IMPORTED_MODULE_13__["default"]);
|
|
259
262
|
|
|
260
263
|
// Add instance detection functions to convert existing objects into
|
|
261
264
|
// the corresponding refract elements.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apidomDatamodel=t():e.apidomDatamodel=t()}(self,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function r(e){return function t(r){return 0===arguments.length||n(r)?t:e.apply(this,arguments)}}function s(e){return function t(s,i){switch(arguments.length){case 0:return t;case 1:return n(s)?t:r(function(t){return e(s,t)});default:return n(s)&&n(i)?t:n(s)?r(function(t){return e(t,i)}):n(i)?r(function(t){return e(s,t)}):e(s,i)}}}function i(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function o(e,t,n){for(var r=0,s=n.length;r<s;){if(e(t,n[r]))return!0;r+=1}return!1}function a(e,t){return Object.prototype.hasOwnProperty.call(t,e)}e.r(t),e.d(t,{AnnotationElement:()=>xe,ArrayElement:()=>J,BooleanElement:()=>G,CloneError:()=>Ee,CollectionElement:()=>F,CommentElement:()=>ze,DeepCloneError:()=>we,Element:()=>C,JSONSerialiser:()=>T,KeyValuePair:()=>j,LinkElement:()=>$,MemberElement:()=>K,Metadata:()=>A,Namespace:()=>ne,NullElement:()=>U,NumberElement:()=>W,ObjectElement:()=>R,ObjectSlice:()=>M,ParseResultElement:()=>De,RefElement:()=>Q,ShallowCloneError:()=>Oe,SourceMapElement:()=>I,StringElement:()=>V,StyleElement:()=>N,cloneDeep:()=>ke,cloneShallow:()=>Pe,hasElementSourceMap:()=>me,hasElementStyle:()=>fe,includesClasses:()=>ye,includesSymbols:()=>pe,isAnnotationElement:()=>qe,isArrayElement:()=>ce,isBooleanElement:()=>ae,isCommentElement:()=>Fe,isElement:()=>re,isLinkElement:()=>Le,isMemberElement:()=>ue,isNullElement:()=>oe,isNumberElement:()=>ie,isObjectElement:()=>le,isParseResultElement:()=>Ke,isPrimitiveElement:()=>he,isRefElement:()=>Ie,isSourceMapElement:()=>Re,isStringElement:()=>se,refract:()=>Ve});const c="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var l=Object.prototype.toString;const u=function(){return"[object Arguments]"===l.call(arguments)?function(e){return"[object Arguments]"===l.call(e)}:function(e){return a("callee",e)}}();var h=!{toString:null}.propertyIsEnumerable("toString"),f=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=function(){return arguments.propertyIsEnumerable("length")}(),p=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const y="function"!=typeof Object.keys||m?r(function(e){if(Object(e)!==e)return[];var t,n,r=[],s=m&&u(e);for(t in e)!a(t,e)||s&&"length"===t||(r[r.length]=t);if(h)for(n=f.length-1;n>=0;)a(t=f[n],e)&&!p(r,t)&&(r[r.length]=t),n-=1;return r}):r(function(e){return Object(e)!==e?[]:Object.keys(e)});const d=r(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function b(e,t,n,r){var s=i(e);function a(e,t){return g(e,t,n.slice(),r.slice())}return!o(function(e,t){return!o(a,t,e)},i(t),s)}function g(e,t,n,r){if(c(e,t))return!0;var s,i,o=d(e);if(o!==d(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(s=e.constructor,null==(i=String(s).match(/^function (\w*)/))?"":i[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!c(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!c(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var l=n.length-1;l>=0;){if(n[l]===e)return r[l]===t;l-=1}switch(o){case"Map":return e.size===t.size&&b(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&b(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var u=y(e);if(u.length!==y(t).length)return!1;var h=n.concat([e]),f=r.concat([t]);for(l=u.length-1;l>=0;){var m=u[l];if(!a(m,t)||!g(t[m],e[m],h,f))return!1;l-=1}return!0}const v=s(function(e,t){return g(e,t,[],[])});function _(e,t,n){if(n||(n=new E),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,s=function(r){var s=n.get(e);if(s)return s;for(var i in n.set(e,r),e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t?_(e[i],!0,n):e[i]);return r};switch(d(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var E=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var n=this.map[t],r=0;r<n.length;r+=1){if((i=n[r])[0]===e)return i[1]}else{var s=this.hash(e);if(n=this.map[s])for(r=0;r<n.length;r+=1){var i;if((i=n[r])[0]===e)return i[1]}}},e}();const w=r(function(e){return null!=e&&"function"==typeof e.clone?e.clone():_(e,!0)});class O{get(e){return this[e]}set(e,t){this[e]=t}hasKey(e){return Object.hasOwn(this,e)}keys(){return Object.keys(this)}remove(e){delete this[e]}get isEmpty(){return 0===Object.keys(this).length}get isFrozen(){return Object.isFrozen(this)}freeze(){for(const e of Object.values(this))e instanceof this.Element?e.freeze():(Array.isArray(e)||null!==e&&"object"==typeof e)&&Object.freeze(e);Object.freeze(this)}cloneShallow(){const e=new O;return Object.assign(e,this),e}merge(e){const t=this.cloneShallow();for(const[n,r]of Object.entries(e)){const e=t.get(n);Array.isArray(e)&&Array.isArray(r)?t.set(n,[...e,...r]):t.set(n,r)}return t}cloneDeep(){const e=new O;for(const[t,n]of Object.entries(this))n instanceof this.Element?e.set(t,this.cloneDeepElement(n)):e.set(t,w(n));return e}}const A=O;const j=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class k{elements;constructor(e){this.elements=e??[]}toValue(){return this.elements.map(e=>({key:e.key?.toValue(),value:e.value?.toValue()}))}map(e,t){return this.elements.map(n=>{const r=n.value,s=n.key;if(void 0===r||void 0===s)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,r,s,n):e(r,s,n)})}filter(e,t){const n=this.elements.filter(n=>{const r=n.value,s=n.key;return void 0!==r&&void 0!==s&&(void 0!==t?e.call(t,r,s,n):e(r,s,n))});return new k(n)}reject(e,t){const n=[];for(const r of this.elements){const s=r.value,i=r.key;void 0!==s&&void 0!==i&&(e.call(t,s,i,r)||n.push(r))}return new k(n)}forEach(e,t){this.elements.forEach((n,r)=>{const s=n.value,i=n.key;void 0!==s&&void 0!==i&&(void 0!==t?e.call(t,s,i,n,r):e(s,i,n,r))})}find(e,t){return this.elements.find(n=>{const r=n.value,s=n.key;return void 0!==r&&void 0!==s&&(void 0!==t?e.call(t,r,s,n):e(r,s,n))})}keys(){return this.elements.map(e=>e.key?.toValue()).filter(e=>void 0!==e)}values(){return this.elements.map(e=>e.value?.toValue()).filter(e=>void 0!==e)}get length(){return this.elements.length}get isEmpty(){return 0===this.length}get first(){return this.elements[0]}get(e){return this.elements[e]}push(e){return this.elements.push(e),this}includesKey(e){return this.elements.some(t=>t.key?.equals(e))}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}const M=k,S=Object.freeze(new A);class P{parent;style;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,n){void 0!==t&&(this.meta=t),void 0!==n&&(this.attributes=n),void 0!==e&&(this.content=e)}get element(){return this._storedElement}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof P)this._content=e;else if(null!=e&&"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&"bigint"!=typeof e&&"symbol"!=typeof e)if(e instanceof j)this._content=e;else if(e instanceof M)this._content=e.elements;else if(Array.isArray(e))this._content=e.map(e=>this.refract(e));else{if("object"!=typeof e)throw new Error("Cannot set content to value of type "+typeof e);this._content=Object.entries(e).map(([e,t])=>new this.MemberElement(e,t))}else this._content=e}get meta(){if(!this._meta){if(this.isFrozen)return S;this._meta=new A}return this._meta}set meta(e){if(e instanceof A)this._meta=e;else if(e&&"object"==typeof e){const t=new A;Object.assign(t,e),this._meta=t}}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof P?this._attributes=e:this.attributes.set(e??{})}get id(){if(!this.hasMetaProperty("id")){if(this.isFrozen)return"";this.setMetaProperty("id","")}return this.meta.get("id")}set id(e){this.setMetaProperty("id",e)}get classes(){if(!this.hasMetaProperty("classes")){if(this.isFrozen)return[];this.setMetaProperty("classes",[])}return this.meta.get("classes")}set classes(e){this.setMetaProperty("classes",e)}get links(){if(!this.hasMetaProperty("links")){if(this.isFrozen){const e=new this.ArrayElement;return e.freeze(),e}this.setMetaProperty("links",new this.ArrayElement)}return this.meta.get("links")}set links(e){this.setMetaProperty("links",e)}get children(){const{_content:e}=this;if(Array.isArray(e))return e;if(e instanceof j){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof P?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&this._meta.freeze(),this._attributes&&(this._attributes.parent=this,this._attributes.freeze());for(const e of this.children)e.parent=this,e.freeze();Array.isArray(this._content)&&Object.freeze(this._content),Object.freeze(this)}}toValue(){const{_content:e}=this;return e instanceof P||e instanceof j?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof P?e.toValue():e;return v(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id;if(""===t)throw new Error("Cannot create reference to an element without an ID");const n=new this.RefElement(t);return"string"==typeof e&&(n.path=this.refract(e)),n}getMetaProperty(e,t){return this.hasMetaProperty(e)?this.meta.get(e):t}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return void 0!==this._meta&&this._meta.hasKey(e)}get isMetaEmpty(){return void 0===this._meta||this._meta.isEmpty}getAttributesProperty(e,t){if(!this.hasAttributesProperty(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.attributes.set(e,t)}return this.attributes.get(e)}setAttributesProperty(e,t){this.attributes.set(e,t)}hasAttributesProperty(e){return!this.isAttributesEmpty&&this.attributes.hasKey(e)}get isAttributesEmpty(){return void 0===this._attributes||this.attributes.isEmpty}}const C=P;const V=class extends C{constructor(e,t,n){super(e,t,n),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};class x extends V{constructor(e,t,n){super(e,t,n),this.element="sourceMap"}static transfer(e,t){t.startLine=e.startLine,t.startCharacter=e.startCharacter,t.startOffset=e.startOffset,t.endLine=e.endLine,t.endCharacter=e.endCharacter,t.endOffset=e.endOffset}static from(e){const{startLine:t,startCharacter:n,startOffset:r,endLine:s,endCharacter:i,endOffset:o}=e;if("number"!=typeof t||"number"!=typeof n||"number"!=typeof r||"number"!=typeof s||"number"!=typeof i||"number"!=typeof o)return;const a="sm1:"+[t,n,r,s,i,o].map(D).join("");const c=new x(a);return c.startLine=t,c.startCharacter=n,c.startOffset=r,c.endLine=s,c.endCharacter=i,c.endOffset=o,c}applyTo(e){this.content&&([e.startLine,e.startCharacter,e.startOffset,e.endLine,e.endCharacter,e.endOffset]=function(e){const t=e.startsWith("sm1:")?e.slice(4):e,n=[];let r=0;for(let e=0;e<6;e++){const e=L(t,r);n.push(e.value),r=e.next}return n}(this.content))}}const z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function D(e){let t=e>>>0,n="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),n+=z[e]}while(0!==t);return n}function L(e,t=0){let n=0,r=0,s=t;for(;;){const t=e[s++],i=z.indexOf(t);if(-1===i)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(n|=(31&i)<<r,r+=5,!!!(32&i))break}return{value:n>>>0,next:s}}const I=x;class q extends C{constructor(e,t,n){super(e||[],t,n)}get length(){return this._content.length}get isEmpty(){return 0===this.length}get first(){return this._content[0]}get second(){return this._content[1]}get last(){return this._content.at(-1)}push(...e){for(const t of e)this._content.push(this.refract(t));return this}shift(){return this._content.shift()}unshift(e){this._content.unshift(this.refract(e))}includes(e){return this._content.some(t=>t.equals(e))}findElements(e,t){const n=t||{},r=!!n.recursive,s=void 0===n.results?[]:n.results;for(let t=0;t<this._content.length;t+=1){const n=this._content[t],i=n;r&&"function"==typeof i.findElements&&i.findElements(e,{results:s,recursive:r}),e(n,t,void 0)&&s.push(n)}return s}find(e){const t=this.findElements(e,{recursive:!0});return new this.ArrayElement(t)}findByElement(e){return this.find(t=>t.element===e)}findByClass(e){return this.find(t=>{const n=t.classes;return"function"==typeof n.includes&&n.includes(e)})}getById(e){return this.find(t=>t.id===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const F=q;const K=class extends C{constructor(e,t,n,r){super(new j,n,r),this.element="member",void 0!==e&&(this.key=e),arguments.length>=2&&(this.value=t)}primitive(){return"member"}get key(){return this._content.key}set key(e){this._content.key=this.refract(e)}get value(){return this._content.value}set value(e){this._content.value=void 0===e?void 0:this.refract(e)}};const R=class extends F{constructor(e,t,n){super(e||[],t,n),this.element="object"}primitive(){return"object"}toValue(){return this._content.reduce((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e),{})}get(e){const t=this.getMember(e);if(t)return t.value}getValue(e){const t=this.get(e);if(t)return t.toValue()}getMember(e){if(void 0!==e)return this._content.find(t=>t.key.toValue()===e)}remove(e){let t=null;return this.content=this._content.filter(n=>n.key.toValue()!==e||(t=n,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const n=this.getMember(e);n?n.value=t:this._content.push(new K(e,t))}else if("object"==typeof e&&!Array.isArray(e))for(const t of Object.keys(e))this.set(t,e[t]);return this}keys(){return this._content.map(e=>e.key.toValue())}values(){return this._content.map(e=>e.value.toValue())}hasKey(e){return this._content.some(t=>t.key.equals(e))}items(){return this._content.map(e=>[e.key.toValue(),e.value.toValue()])}map(e,t){return this._content.map(n=>e.call(t,n.value,n.key,n))}compactMap(e,t){const n=[];return this.forEach((r,s,i)=>{const o=e.call(t,r,s,i);o&&n.push(o)}),n}filter(e,t){return new M(this._content).filter(e,t)}reject(e,t){const n=[];for(const r of this._content)e.call(t,r.value,r.key,r)||n.push(r);return new M(n)}forEach(e,t){this._content.forEach(n=>e.call(t,n.value,n.key,n))}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r=this._content[0]?.value);for(let t=n;t<this._content.length;t+=1){const n=this._content[t],s=e(r,n.value,n.key,n,this);r=void 0===s?s:this.refract(s)}return r}empty(){return new this.constructor([])}};class B extends R{constructor(e,t,n){super(e,t,n),this.element="__styles__"}static transfer(e,t){t.style=e.style}static from(e){if(e.style)return new B(e.style)}applyTo(e){e.style=this.toValue()}}const N=B;const T=class{namespace;constructor(e){this.namespace=e||new this.Namespace}serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);const t={element:e.element};if(!e.isMetaEmpty){const n=this.serialiseMeta(e);n&&(t.meta=n.meta,n.rawKeys.length>0&&(t.__meta_raw__=n.rawKeys))}if(e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof I)){const n=I.from(e);n&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(n))}if(!(e instanceof N)){const n=N.from(e);n&&(t.meta||(t.meta={}),t.meta.__styles__=this.serialise(n))}const n=this.serialiseContent(e.content);return void 0!==n&&(t.content=n),t}deserialise(e){if(!e.element)throw new Error("Given value is not an object containing an element name");const t=new(this.namespace.getElementClass(e.element));let n,r;t.element!==e.element&&(t.element=e.element);let s=e.meta;if(e.meta?.__mappings__||e.meta?.__styles__){const{__mappings__:t,__styles__:i,...o}=e.meta;n=t,r=i,s=Object.keys(o).length>0?o:void 0}const i=e.__meta_raw__?new Set(e.__meta_raw__):void 0;if(s)for(const[e,n]of Object.entries(s)){const r=this.deserialise(n);t.setMetaProperty(e,i?.has(e)?r.toValue():r)}if(n){this.deserialise(n).applyTo(t)}if(r){this.deserialise(r).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const o=this.deserialiseContent(e.content);return void 0===o&&null!==t.content||(t.content=o),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t=e,n={key:this.serialise(t.key)};return t.value&&(n.value=this.serialise(t.value)),n}if(e&&Array.isArray(e)){if(0===e.length)return;return e.map(e=>this.serialise(e))}return e}deserialiseContent(e){if(e){if(e.element)return this.deserialise(e);if(e.key){const t=new this.namespace.KeyValuePair(this.deserialise(e.key));return e.value&&(t.value=this.deserialise(e.value)),t}if(Array.isArray(e))return e.map(e=>this.deserialise(e))}return e}serialiseMeta(e){const t={},n=[];let r=!1;for(const[s,i]of Object.entries(e.meta))if(i instanceof this.namespace.elements.Element)t[s]=this.serialise(i),r=!0;else if(void 0!==i){const o=e.refract(i);t[s]=this.serialise(o),n.push(s),r=!0}return r?{meta:t,rawKeys:n}:void 0}serialiseObject(e){const t={};if(e.forEach((e,n)=>{e&&(t[n.toValue()]=this.serialise(e))}),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach(n=>{t.set(n,this.deserialise(e[n]))})}};const U=class extends C{constructor(e,t,n){super(e??null,t,n),this.element="null"}primitive(){return"null"}set(e){throw new Error("Cannot set the value of null")}};const W=class extends C{constructor(e,t,n){super(e,t,n),this.element="number"}primitive(){return"number"}};const G=class extends C{constructor(e,t,n){super(e,t,n),this.element="boolean"}primitive(){return"boolean"}};const J=class extends F{constructor(e,t,n){super(e||[],t,n),this.element="array"}primitive(){return"array"}get(e){return this._content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}set(e,t){return"number"==typeof e&&void 0!==t?this._content[e]=this.refract(t):this.content=e,this}remove(e){return this._content.splice(e,1)[0]??null}map(e,t){return this._content.map(e,t)}flatMap(e,t){return this._content.flatMap(e,t)}compactMap(e,t){const n=[];for(const r of this._content){const s=e.call(t,r);s&&n.push(s)}return n}filter(e,t){const n=this._content.filter(e,t);return new this.constructor(n)}reject(e,t){const n=[];for(const r of this._content)e.call(t,r)||n.push(r);return new this.constructor(n)}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r=this.first);for(let t=n;t<this.length;t+=1){const n=e(r,this._content[t],t,this);r=void 0===n?n:this.refract(n)}return r}forEach(e,t){this._content.forEach((n,r)=>{e.call(t,n,r)})}empty(){return new this.constructor([])}};const Q=class extends C{constructor(e,t,n){super(e||[],t,n),this.element="ref",this.path||(this.path="element")}get path(){if(this.hasAttributesProperty("path"))return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}};const $=class extends C{constructor(e,t,n){super(e||[],t,n),this.element="link"}get relation(){if(this.hasAttributesProperty("relation"))return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){if(this.hasAttributesProperty("href"))return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}},H=e=>null===e,X=e=>"string"==typeof e,Y=e=>"number"==typeof e,Z=e=>"boolean"==typeof e,ee=e=>null!==e&&"object"==typeof e;class te{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=C,this.KeyValuePair=j,e&&e.noDefault||this.useDefault()}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",U).register("string",V).register("number",W).register("boolean",G).register("array",J).register("object",R).register("member",K).register("ref",Q).register("link",$).register("sourceMap",I),this.detect(H,U,!1).detect(X,V,!1).detect(Y,W,!1).detect(Z,G,!1).detect(Array.isArray,J,!1).detect(ee,R,!1),this}register(e,t){return this._elements=void 0,this.elementMap[e]=t,this}unregister(e){return this._elements=void 0,delete this.elementMap[e],this}detect(e,t,n){return void 0===n||n?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(const[n,r]of this.elementDetection)if(n(e)){t=new r(e);break}return t}getElementClass(e){const t=this.elementMap[e];return void 0===t?this.Element:t}fromRefract(e){return this.serialiser.deserialise(e)}toRefract(e){return this.serialiser.serialise(e)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach(e=>{const t=e[0].toUpperCase()+e.substring(1);this._elements[t]=this.elementMap[e]})),this._elements}get serialiser(){return new T(this)}}T.prototype.Namespace=te;const ne=te,re=e=>e instanceof C,se=e=>e instanceof V,ie=e=>e instanceof W,oe=e=>e instanceof U,ae=e=>e instanceof G,ce=e=>e instanceof J,le=e=>e instanceof R,ue=e=>e instanceof K,he=e=>le(e)&&"object"===e.element||ce(e)&&"array"===e.element||ae(e)&&"boolean"===e.element||ie(e)&&"number"===e.element||se(e)&&"string"===e.element||oe(e)&&"null"===e.element||ue(e)&&"member"===e.element,fe=e=>void 0!==e.style,me=e=>"number"==typeof e.startLine&&"number"==typeof e.startCharacter&&"number"==typeof e.startOffset&&"number"==typeof e.endLine&&"number"==typeof e.endCharacter&&"number"==typeof e.endOffset,pe=(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const n=e.attributes.get("symbols");return!!ce(n)&&t.every(e=>n.includes(e))},ye=(e,t)=>0===t.length||!!re(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));class de extends AggregateError{constructor(e,t,n){super(e,t,n),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const be=de;class ge extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(be,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const ve=ge;const _e=class extends ve{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}};const Ee=class extends _e{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const we=class extends Ee{};const Oe=class extends Ee{},Ae=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=Se(e);n.set(e,s);const{content:i}=e;return Array.isArray(i)?s.content=i.map(e=>Ae(e,r)):re(i)?s.content=Ae(i,r):s.content=i instanceof j?je(i,r):i,s},je=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const{key:s,value:i}=e,o=void 0!==s?Ae(s,r):void 0,a=void 0!==i?Ae(i,r):void 0,c=new j(o,a);return n.set(e,c),c},ke=(e,t={})=>{if(e instanceof j)return je(e,t);if(e instanceof M)return((e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=[...e].map(e=>Ae(e,r)),i=new M(s);return n.set(e,i),i})(e,t);if(re(e))return Ae(e,t);throw new we("Value provided to cloneDeep function couldn't be cloned",{value:e})};ke.safe=e=>{try{return ke(e)}catch{return e}};const Me=e=>{const{key:t,value:n}=e;return new j(t,n)},Se=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=e.meta.cloneDeep()),e.isAttributesEmpty||(t.attributes=ke(e.attributes)),me(e)&&I.transfer(e,t),fe(e)&&(t.style=w(e.style));const{content:n}=e;return re(n)?t.content=Se(n):Array.isArray(n)?t.content=[...n]:t.content=n instanceof j?Me(n):n,t},Pe=e=>{if(e instanceof j)return Me(e);if(e instanceof M)return(e=>{const t=[...e];return new M(t)})(e);if(re(e))return Se(e);throw new Oe("Value provided to cloneShallow function couldn't be cloned",{value:e})};function Ce(e){return void 0===e?new U:Ve(e)}function Ve(e){if(e instanceof C)return e;if("string"==typeof e)return new V(e);if("number"==typeof e)return new W(e);if("boolean"==typeof e)return new G(e);if(null===e)return new U;if(Array.isArray(e))return new J(e.map(Ce));if("object"==typeof e)return new R(e);throw new Error("Cannot refract value of type "+typeof e)}Pe.safe=e=>{try{return Pe(e)}catch{return e}},C.prototype.ObjectElement=R,C.prototype.ArrayElement=J,C.prototype.RefElement=Q,C.prototype.MemberElement=K,C.prototype.refract=Ve,A.prototype.Element=C,A.prototype.cloneDeepElement=e=>ke(e);const xe=class extends V{constructor(e,t,n){super(e,t,n),this.element="annotation"}get code(){if(this.hasAttributesProperty("code"))return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}};const ze=class extends V{constructor(e,t,n){super(e,t,n),this.element="comment"}};const De=class extends J{constructor(e,t,n){super(e,t,n),this.element="parseResult"}get api(){return this.filter(e=>ye(e,["api"])).first}get results(){return this.filter(e=>ye(e,["result"]))}get result(){return this.results.first}get annotations(){return this.filter(e=>"annotation"===e.element)}get warnings(){return this.filter(e=>"annotation"===e.element&&ye(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&ye(e,["error"]))}get isEmpty(){return 0===this.reject(e=>"annotation"===e.element).length}replaceResult(e){const{result:t}=this;if(void 0===t)return!1;const n=this._content,r=n.findIndex(e=>e===t);return-1!==r&&(n[r]=e,!0)}},Le=e=>e instanceof $,Ie=e=>e instanceof Q,qe=e=>e instanceof xe,Fe=e=>e instanceof ze,Ke=e=>e instanceof De,Re=e=>e instanceof I;return t})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apidomDatamodel=t():e.apidomDatamodel=t()}(self,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function r(e){return function t(r){return 0===arguments.length||n(r)?t:e.apply(this,arguments)}}function s(e){return function t(s,i){switch(arguments.length){case 0:return t;case 1:return n(s)?t:r(function(t){return e(s,t)});default:return n(s)&&n(i)?t:n(s)?r(function(t){return e(t,i)}):n(i)?r(function(t){return e(s,t)}):e(s,i)}}}function i(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function o(e,t,n){for(var r=0,s=n.length;r<s;){if(e(t,n[r]))return!0;r+=1}return!1}function a(e,t){return Object.prototype.hasOwnProperty.call(t,e)}e.r(t),e.d(t,{AnnotationElement:()=>H,ArrayElement:()=>J,BooleanElement:()=>G,CloneError:()=>Ae,CollectionElement:()=>F,CommentElement:()=>X,DeepCloneError:()=>je,Element:()=>C,JSONSerialiser:()=>T,KeyValuePair:()=>j,LinkElement:()=>$,MemberElement:()=>K,Metadata:()=>A,Namespace:()=>ge,NullElement:()=>U,NumberElement:()=>W,ObjectElement:()=>R,ObjectSlice:()=>M,ParseResultElement:()=>he,RefElement:()=>Q,ShallowCloneError:()=>ke,SourceMapElement:()=>I,StringElement:()=>V,StyleElement:()=>N,cloneDeep:()=>Pe,cloneShallow:()=>xe,hasElementSourceMap:()=>ce,hasElementStyle:()=>ae,includesClasses:()=>ue,includesSymbols:()=>le,isAnnotationElement:()=>qe,isArrayElement:()=>re,isBooleanElement:()=>ne,isCommentElement:()=>Fe,isElement:()=>Y,isLinkElement:()=>Le,isMemberElement:()=>ie,isNullElement:()=>te,isNumberElement:()=>ee,isObjectElement:()=>se,isParseResultElement:()=>Ke,isPrimitiveElement:()=>oe,isRefElement:()=>Ie,isSourceMapElement:()=>Re,isStringElement:()=>Z,refract:()=>De});const c="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var l=Object.prototype.toString;const u=function(){return"[object Arguments]"===l.call(arguments)?function(e){return"[object Arguments]"===l.call(e)}:function(e){return a("callee",e)}}();var h=!{toString:null}.propertyIsEnumerable("toString"),f=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=function(){return arguments.propertyIsEnumerable("length")}(),p=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const y="function"!=typeof Object.keys||m?r(function(e){if(Object(e)!==e)return[];var t,n,r=[],s=m&&u(e);for(t in e)!a(t,e)||s&&"length"===t||(r[r.length]=t);if(h)for(n=f.length-1;n>=0;)a(t=f[n],e)&&!p(r,t)&&(r[r.length]=t),n-=1;return r}):r(function(e){return Object(e)!==e?[]:Object.keys(e)});const d=r(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function b(e,t,n,r){var s=i(e);function a(e,t){return g(e,t,n.slice(),r.slice())}return!o(function(e,t){return!o(a,t,e)},i(t),s)}function g(e,t,n,r){if(c(e,t))return!0;var s,i,o=d(e);if(o!==d(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(s=e.constructor,null==(i=String(s).match(/^function (\w*)/))?"":i[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!c(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!c(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var l=n.length-1;l>=0;){if(n[l]===e)return r[l]===t;l-=1}switch(o){case"Map":return e.size===t.size&&b(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&b(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var u=y(e);if(u.length!==y(t).length)return!1;var h=n.concat([e]),f=r.concat([t]);for(l=u.length-1;l>=0;){var m=u[l];if(!a(m,t)||!g(t[m],e[m],h,f))return!1;l-=1}return!0}const v=s(function(e,t){return g(e,t,[],[])});function _(e,t,n){if(n||(n=new E),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,s=function(r){var s=n.get(e);if(s)return s;for(var i in n.set(e,r),e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t?_(e[i],!0,n):e[i]);return r};switch(d(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var E=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var n=this.map[t],r=0;r<n.length;r+=1){if((i=n[r])[0]===e)return i[1]}else{var s=this.hash(e);if(n=this.map[s])for(r=0;r<n.length;r+=1){var i;if((i=n[r])[0]===e)return i[1]}}},e}();const w=r(function(e){return null!=e&&"function"==typeof e.clone?e.clone():_(e,!0)});class O{get(e){return this[e]}set(e,t){this[e]=t}hasKey(e){return Object.hasOwn(this,e)}keys(){return Object.keys(this)}remove(e){delete this[e]}get isEmpty(){return 0===Object.keys(this).length}get isFrozen(){return Object.isFrozen(this)}freeze(){for(const e of Object.values(this))e instanceof this.Element?e.freeze():(Array.isArray(e)||null!==e&&"object"==typeof e)&&Object.freeze(e);Object.freeze(this)}cloneShallow(){const e=new O;return Object.assign(e,this),e}merge(e){const t=this.cloneShallow();for(const[n,r]of Object.entries(e)){const e=t.get(n);Array.isArray(e)&&Array.isArray(r)?t.set(n,[...e,...r]):t.set(n,r)}return t}cloneDeep(){const e=new O;for(const[t,n]of Object.entries(this))n instanceof this.Element?e.set(t,this.cloneDeepElement(n)):e.set(t,w(n));return e}}const A=O;const j=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class k{elements;constructor(e){this.elements=e??[]}toValue(){return this.elements.map(e=>({key:e.key?.toValue(),value:e.value?.toValue()}))}map(e,t){return this.elements.map(n=>{const r=n.value,s=n.key;if(void 0===r||void 0===s)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,r,s,n):e(r,s,n)})}filter(e,t){const n=this.elements.filter(n=>{const r=n.value,s=n.key;return void 0!==r&&void 0!==s&&(void 0!==t?e.call(t,r,s,n):e(r,s,n))});return new k(n)}reject(e,t){const n=[];for(const r of this.elements){const s=r.value,i=r.key;void 0!==s&&void 0!==i&&(e.call(t,s,i,r)||n.push(r))}return new k(n)}forEach(e,t){this.elements.forEach((n,r)=>{const s=n.value,i=n.key;void 0!==s&&void 0!==i&&(void 0!==t?e.call(t,s,i,n,r):e(s,i,n,r))})}find(e,t){return this.elements.find(n=>{const r=n.value,s=n.key;return void 0!==r&&void 0!==s&&(void 0!==t?e.call(t,r,s,n):e(r,s,n))})}keys(){return this.elements.map(e=>e.key?.toValue()).filter(e=>void 0!==e)}values(){return this.elements.map(e=>e.value?.toValue()).filter(e=>void 0!==e)}get length(){return this.elements.length}get isEmpty(){return 0===this.length}get first(){return this.elements[0]}get(e){return this.elements[e]}push(e){return this.elements.push(e),this}includesKey(e){return this.elements.some(t=>t.key?.equals(e))}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}const M=k,S=Object.freeze(new A);class P{parent;style;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,n){void 0!==t&&(this.meta=t),void 0!==n&&(this.attributes=n),void 0!==e&&(this.content=e)}get element(){return this._storedElement}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof P)this._content=e;else if(null!=e&&"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&"bigint"!=typeof e&&"symbol"!=typeof e)if(e instanceof j)this._content=e;else if(e instanceof M)this._content=e.elements;else if(Array.isArray(e))this._content=e.map(e=>this.refract(e));else{if("object"!=typeof e)throw new Error("Cannot set content to value of type "+typeof e);this._content=Object.entries(e).map(([e,t])=>new this.MemberElement(e,t))}else this._content=e}get meta(){if(!this._meta){if(this.isFrozen)return S;this._meta=new A}return this._meta}set meta(e){if(e instanceof A)this._meta=e;else if(e&&"object"==typeof e){const t=new A;Object.assign(t,e),this._meta=t}}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof P?this._attributes=e:this.attributes.set(e??{})}get id(){if(!this.hasMetaProperty("id")){if(this.isFrozen)return"";this.setMetaProperty("id","")}return this.meta.get("id")}set id(e){this.setMetaProperty("id",e)}get classes(){if(!this.hasMetaProperty("classes")){if(this.isFrozen)return[];this.setMetaProperty("classes",[])}return this.meta.get("classes")}set classes(e){this.setMetaProperty("classes",e)}get links(){if(!this.hasMetaProperty("links")){if(this.isFrozen){const e=new this.ArrayElement;return e.freeze(),e}this.setMetaProperty("links",new this.ArrayElement)}return this.meta.get("links")}set links(e){this.setMetaProperty("links",e)}get children(){const{_content:e}=this;if(Array.isArray(e))return e;if(e instanceof j){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof P?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&this._meta.freeze(),this._attributes&&(this._attributes.parent=this,this._attributes.freeze());for(const e of this.children)e.parent=this,e.freeze();Array.isArray(this._content)&&Object.freeze(this._content),Object.freeze(this)}}toValue(){const{_content:e}=this;return e instanceof P||e instanceof j?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof P?e.toValue():e;return v(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id;if(""===t)throw new Error("Cannot create reference to an element without an ID");const n=new this.RefElement(t);return"string"==typeof e&&(n.path=this.refract(e)),n}getMetaProperty(e,t){return this.hasMetaProperty(e)?this.meta.get(e):t}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return void 0!==this._meta&&this._meta.hasKey(e)}get isMetaEmpty(){return void 0===this._meta||this._meta.isEmpty}getAttributesProperty(e,t){if(!this.hasAttributesProperty(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.attributes.set(e,t)}return this.attributes.get(e)}setAttributesProperty(e,t){this.attributes.set(e,t)}hasAttributesProperty(e){return!this.isAttributesEmpty&&this.attributes.hasKey(e)}get isAttributesEmpty(){return void 0===this._attributes||this.attributes.isEmpty}}const C=P;const V=class extends C{constructor(e,t,n){super(e,t,n),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};class x extends V{constructor(e,t,n){super(e,t,n),this.element="sourceMap"}static transfer(e,t){t.startLine=e.startLine,t.startCharacter=e.startCharacter,t.startOffset=e.startOffset,t.endLine=e.endLine,t.endCharacter=e.endCharacter,t.endOffset=e.endOffset}static from(e){const{startLine:t,startCharacter:n,startOffset:r,endLine:s,endCharacter:i,endOffset:o}=e;if("number"!=typeof t||"number"!=typeof n||"number"!=typeof r||"number"!=typeof s||"number"!=typeof i||"number"!=typeof o)return;const a="sm1:"+[t,n,r,s,i,o].map(D).join("");const c=new x(a);return c.startLine=t,c.startCharacter=n,c.startOffset=r,c.endLine=s,c.endCharacter=i,c.endOffset=o,c}applyTo(e){this.content&&([e.startLine,e.startCharacter,e.startOffset,e.endLine,e.endCharacter,e.endOffset]=function(e){const t=e.startsWith("sm1:")?e.slice(4):e,n=[];let r=0;for(let e=0;e<6;e++){const e=L(t,r);n.push(e.value),r=e.next}return n}(this.content))}}const z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function D(e){let t=e>>>0,n="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),n+=z[e]}while(0!==t);return n}function L(e,t=0){let n=0,r=0,s=t;for(;;){const t=e[s++],i=z.indexOf(t);if(-1===i)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(n|=(31&i)<<r,r+=5,!!!(32&i))break}return{value:n>>>0,next:s}}const I=x;class q extends C{constructor(e,t,n){super(e||[],t,n)}get length(){return this._content.length}get isEmpty(){return 0===this.length}get first(){return this._content[0]}get second(){return this._content[1]}get last(){return this._content.at(-1)}push(...e){for(const t of e)this._content.push(this.refract(t));return this}shift(){return this._content.shift()}unshift(e){this._content.unshift(this.refract(e))}includes(e){return this._content.some(t=>t.equals(e))}findElements(e,t){const n=t||{},r=!!n.recursive,s=void 0===n.results?[]:n.results;for(let t=0;t<this._content.length;t+=1){const n=this._content[t],i=n;r&&"function"==typeof i.findElements&&i.findElements(e,{results:s,recursive:r}),e(n,t,void 0)&&s.push(n)}return s}find(e){const t=this.findElements(e,{recursive:!0});return new this.ArrayElement(t)}findByElement(e){return this.find(t=>t.element===e)}findByClass(e){return this.find(t=>{const n=t.classes;return"function"==typeof n.includes&&n.includes(e)})}getById(e){return this.find(t=>t.id===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const F=q;const K=class extends C{constructor(e,t,n,r){super(new j,n,r),this.element="member",void 0!==e&&(this.key=e),arguments.length>=2&&(this.value=t)}primitive(){return"member"}get key(){return this._content.key}set key(e){this._content.key=this.refract(e)}get value(){return this._content.value}set value(e){this._content.value=void 0===e?void 0:this.refract(e)}};const R=class extends F{constructor(e,t,n){super(e||[],t,n),this.element="object"}primitive(){return"object"}toValue(){return this._content.reduce((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e),{})}get(e){const t=this.getMember(e);if(t)return t.value}getValue(e){const t=this.get(e);if(t)return t.toValue()}getMember(e){if(void 0!==e)return this._content.find(t=>t.key.toValue()===e)}remove(e){let t=null;return this.content=this._content.filter(n=>n.key.toValue()!==e||(t=n,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const n=this.getMember(e);n?n.value=t:this._content.push(new K(e,t))}else if("object"==typeof e&&!Array.isArray(e))for(const t of Object.keys(e))this.set(t,e[t]);return this}keys(){return this._content.map(e=>e.key.toValue())}values(){return this._content.map(e=>e.value.toValue())}hasKey(e){return this._content.some(t=>t.key.equals(e))}items(){return this._content.map(e=>[e.key.toValue(),e.value.toValue()])}map(e,t){return this._content.map(n=>e.call(t,n.value,n.key,n))}compactMap(e,t){const n=[];return this.forEach((r,s,i)=>{const o=e.call(t,r,s,i);o&&n.push(o)}),n}filter(e,t){return new M(this._content).filter(e,t)}reject(e,t){const n=[];for(const r of this._content)e.call(t,r.value,r.key,r)||n.push(r);return new M(n)}forEach(e,t){this._content.forEach(n=>e.call(t,n.value,n.key,n))}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r=this._content[0]?.value);for(let t=n;t<this._content.length;t+=1){const n=this._content[t],s=e(r,n.value,n.key,n,this);r=void 0===s?s:this.refract(s)}return r}empty(){return new this.constructor([])}};class B extends R{constructor(e,t,n){super(e,t,n),this.element="__styles__"}static transfer(e,t){t.style=e.style}static from(e){if(e.style)return new B(e.style)}applyTo(e){e.style=this.toValue()}}const N=B;const T=class{namespace;constructor(e){this.namespace=e||new this.Namespace}serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);const t={element:e.element};if(!e.isMetaEmpty){const n=this.serialiseMeta(e);n&&(t.meta=n.meta,n.rawKeys.length>0&&(t.__meta_raw__=n.rawKeys))}if(e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof I)){const n=I.from(e);n&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(n))}if(!(e instanceof N)){const n=N.from(e);n&&(t.meta||(t.meta={}),t.meta.__styles__=this.serialise(n))}const n=this.serialiseContent(e.content);return void 0!==n&&(t.content=n),t}deserialise(e){if(!e.element)throw new Error("Given value is not an object containing an element name");const t=new(this.namespace.getElementClass(e.element));let n,r;t.element!==e.element&&(t.element=e.element);let s=e.meta;if(e.meta?.__mappings__||e.meta?.__styles__){const{__mappings__:t,__styles__:i,...o}=e.meta;n=t,r=i,s=Object.keys(o).length>0?o:void 0}const i=e.__meta_raw__?new Set(e.__meta_raw__):void 0;if(s)for(const[e,n]of Object.entries(s)){const r=this.deserialise(n);t.setMetaProperty(e,i?.has(e)?r.toValue():r)}if(n){this.deserialise(n).applyTo(t)}if(r){this.deserialise(r).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const o=this.deserialiseContent(e.content);return void 0===o&&null!==t.content||(t.content=o),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t=e,n={key:this.serialise(t.key)};return t.value&&(n.value=this.serialise(t.value)),n}if(e&&Array.isArray(e)){if(0===e.length)return;return e.map(e=>this.serialise(e))}return e}deserialiseContent(e){if(e){if(e.element)return this.deserialise(e);if(e.key){const t=new this.namespace.KeyValuePair(this.deserialise(e.key));return e.value&&(t.value=this.deserialise(e.value)),t}if(Array.isArray(e))return e.map(e=>this.deserialise(e))}return e}serialiseMeta(e){const t={},n=[];let r=!1;for(const[s,i]of Object.entries(e.meta))if(i instanceof this.namespace.elements.Element)t[s]=this.serialise(i),r=!0;else if(void 0!==i){const o=e.refract(i);t[s]=this.serialise(o),n.push(s),r=!0}return r?{meta:t,rawKeys:n}:void 0}serialiseObject(e){const t={};if(e.forEach((e,n)=>{e&&(t[n.toValue()]=this.serialise(e))}),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach(n=>{t.set(n,this.deserialise(e[n]))})}};const U=class extends C{constructor(e,t,n){super(e??null,t,n),this.element="null"}primitive(){return"null"}set(e){throw new Error("Cannot set the value of null")}};const W=class extends C{constructor(e,t,n){super(e,t,n),this.element="number"}primitive(){return"number"}};const G=class extends C{constructor(e,t,n){super(e,t,n),this.element="boolean"}primitive(){return"boolean"}};const J=class extends F{constructor(e,t,n){super(e||[],t,n),this.element="array"}primitive(){return"array"}get(e){return this._content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}set(e,t){return"number"==typeof e&&void 0!==t?this._content[e]=this.refract(t):this.content=e,this}remove(e){return this._content.splice(e,1)[0]??null}map(e,t){return this._content.map(e,t)}flatMap(e,t){return this._content.flatMap(e,t)}compactMap(e,t){const n=[];for(const r of this._content){const s=e.call(t,r);s&&n.push(s)}return n}filter(e,t){const n=this._content.filter(e,t);return new this.constructor(n)}reject(e,t){const n=[];for(const r of this._content)e.call(t,r)||n.push(r);return new this.constructor(n)}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r=this.first);for(let t=n;t<this.length;t+=1){const n=e(r,this._content[t],t,this);r=void 0===n?n:this.refract(n)}return r}forEach(e,t){this._content.forEach((n,r)=>{e.call(t,n,r)})}empty(){return new this.constructor([])}};const Q=class extends C{constructor(e,t,n){super(e||[],t,n),this.element="ref",this.path||(this.path="element")}get path(){if(this.hasAttributesProperty("path"))return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}};const $=class extends C{constructor(e,t,n){super(e||[],t,n),this.element="link"}get relation(){if(this.hasAttributesProperty("relation"))return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){if(this.hasAttributesProperty("href"))return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}};const H=class extends V{constructor(e,t,n){super(e,t,n),this.element="annotation"}get code(){if(this.hasAttributesProperty("code"))return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}};const X=class extends V{constructor(e,t,n){super(e,t,n),this.element="comment"}},Y=e=>e instanceof C,Z=e=>e instanceof V,ee=e=>e instanceof W,te=e=>e instanceof U,ne=e=>e instanceof G,re=e=>e instanceof J,se=e=>e instanceof R,ie=e=>e instanceof K,oe=e=>se(e)&&"object"===e.element||re(e)&&"array"===e.element||ne(e)&&"boolean"===e.element||ee(e)&&"number"===e.element||Z(e)&&"string"===e.element||te(e)&&"null"===e.element||ie(e)&&"member"===e.element,ae=e=>void 0!==e.style,ce=e=>"number"==typeof e.startLine&&"number"==typeof e.startCharacter&&"number"==typeof e.startOffset&&"number"==typeof e.endLine&&"number"==typeof e.endCharacter&&"number"==typeof e.endOffset,le=(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const n=e.attributes.get("symbols");return!!re(n)&&t.every(e=>n.includes(e))},ue=(e,t)=>0===t.length||!!Y(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));const he=class extends J{constructor(e,t,n){super(e,t,n),this.element="parseResult"}get api(){return this.filter(e=>ue(e,["api"])).first}get results(){return this.filter(e=>ue(e,["result"]))}get result(){return this.results.first}get annotations(){return this.filter(e=>"annotation"===e.element)}get warnings(){return this.filter(e=>"annotation"===e.element&&ue(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&ue(e,["error"]))}get isEmpty(){return 0===this.reject(e=>"annotation"===e.element).length}replaceResult(e){const{result:t}=this;if(void 0===t)return!1;const n=this._content,r=n.findIndex(e=>e===t);return-1!==r&&(n[r]=e,!0)}},fe=e=>null===e,me=e=>"string"==typeof e,pe=e=>"number"==typeof e,ye=e=>"boolean"==typeof e,de=e=>null!==e&&"object"==typeof e;class be{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=C,this.KeyValuePair=j,e&&e.noDefault||this.useDefault()}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",U).register("string",V).register("number",W).register("boolean",G).register("array",J).register("object",R).register("member",K).register("ref",Q).register("link",$).register("sourceMap",I).register("annotation",H).register("comment",X).register("parseResult",he),this.detect(fe,U,!1).detect(me,V,!1).detect(pe,W,!1).detect(ye,G,!1).detect(Array.isArray,J,!1).detect(de,R,!1),this}register(e,t){return this._elements=void 0,this.elementMap[e]=t,this}unregister(e){return this._elements=void 0,delete this.elementMap[e],this}detect(e,t,n){return void 0===n||n?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(const[n,r]of this.elementDetection)if(n(e)){t=new r(e);break}return t}getElementClass(e){const t=this.elementMap[e];return void 0===t?this.Element:t}fromRefract(e){return this.serialiser.deserialise(e)}toRefract(e){return this.serialiser.serialise(e)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach(e=>{const t=e[0].toUpperCase()+e.substring(1);this._elements[t]=this.elementMap[e]})),this._elements}get serialiser(){return new T(this)}}T.prototype.Namespace=be;const ge=be;class ve extends AggregateError{constructor(e,t,n){super(e,t,n),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const _e=ve;class Ee extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(_e,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const we=Ee;const Oe=class extends we{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...n}=t;Object.assign(this,n)}}};const Ae=class extends Oe{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const je=class extends Ae{};const ke=class extends Ae{},Me=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=Ve(e);n.set(e,s);const{content:i}=e;return Array.isArray(i)?s.content=i.map(e=>Me(e,r)):Y(i)?s.content=Me(i,r):s.content=i instanceof j?Se(i,r):i,s},Se=(e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const{key:s,value:i}=e,o=void 0!==s?Me(s,r):void 0,a=void 0!==i?Me(i,r):void 0,c=new j(o,a);return n.set(e,c),c},Pe=(e,t={})=>{if(e instanceof j)return Se(e,t);if(e instanceof M)return((e,t)=>{const{visited:n=new WeakMap}=t,r={...t,visited:n};if(n.has(e))return n.get(e);const s=[...e].map(e=>Me(e,r)),i=new M(s);return n.set(e,i),i})(e,t);if(Y(e))return Me(e,t);throw new je("Value provided to cloneDeep function couldn't be cloned",{value:e})};Pe.safe=e=>{try{return Pe(e)}catch{return e}};const Ce=e=>{const{key:t,value:n}=e;return new j(t,n)},Ve=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=e.meta.cloneDeep()),e.isAttributesEmpty||(t.attributes=Pe(e.attributes)),ce(e)&&I.transfer(e,t),ae(e)&&(t.style=w(e.style));const{content:n}=e;return Y(n)?t.content=Ve(n):Array.isArray(n)?t.content=[...n]:t.content=n instanceof j?Ce(n):n,t},xe=e=>{if(e instanceof j)return Ce(e);if(e instanceof M)return(e=>{const t=[...e];return new M(t)})(e);if(Y(e))return Ve(e);throw new ke("Value provided to cloneShallow function couldn't be cloned",{value:e})};function ze(e){return void 0===e?new U:De(e)}function De(e){if(e instanceof C)return e;if("string"==typeof e)return new V(e);if("number"==typeof e)return new W(e);if("boolean"==typeof e)return new G(e);if(null===e)return new U;if(Array.isArray(e))return new J(e.map(ze));if("object"==typeof e)return new R(e);throw new Error("Cannot refract value of type "+typeof e)}xe.safe=e=>{try{return xe(e)}catch{return e}},C.prototype.ObjectElement=R,C.prototype.ArrayElement=J,C.prototype.RefElement=Q,C.prototype.MemberElement=K,C.prototype.refract=De,A.prototype.Element=C,A.prototype.cloneDeepElement=e=>Pe(e);const Le=e=>e instanceof $,Ie=e=>e instanceof Q,qe=e=>e instanceof H,Fe=e=>e instanceof X,Ke=e=>e instanceof he,Re=e=>e instanceof I;return t})());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speclynx/apidom-datamodel",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"description": "Data model primitives for ApiDOM.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apidom",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"license": "Apache-2.0",
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@babel/runtime-corejs3": "^8.0.0",
|
|
58
|
-
"@speclynx/apidom-error": "4.
|
|
58
|
+
"@speclynx/apidom-error": "4.13.0",
|
|
59
59
|
"ramda": "~0.32.0"
|
|
60
60
|
},
|
|
61
61
|
"files": [
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"README.md",
|
|
69
69
|
"CHANGELOG.md"
|
|
70
70
|
],
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "178b5324324332132479271fb9ac747a7ddbfccc"
|
|
72
72
|
}
|
package/src/Namespace.cjs
CHANGED
|
@@ -94,7 +94,7 @@ class Namespace {
|
|
|
94
94
|
*/
|
|
95
95
|
useDefault() {
|
|
96
96
|
// Set up classes for default elements
|
|
97
|
-
this.register('null', elements.NullElement).register('string', elements.StringElement).register('number', elements.NumberElement).register('boolean', elements.BooleanElement).register('array', elements.ArrayElement).register('object', elements.ObjectElement).register('member', elements.MemberElement).register('ref', elements.RefElement).register('link', elements.LinkElement).register('sourceMap', elements.SourceMapElement);
|
|
97
|
+
this.register('null', elements.NullElement).register('string', elements.StringElement).register('number', elements.NumberElement).register('boolean', elements.BooleanElement).register('array', elements.ArrayElement).register('object', elements.ObjectElement).register('member', elements.MemberElement).register('ref', elements.RefElement).register('link', elements.LinkElement).register('sourceMap', elements.SourceMapElement).register('annotation', elements.AnnotationElement).register('comment', elements.CommentElement).register('parseResult', elements.ParseResultElement);
|
|
98
98
|
|
|
99
99
|
// Add instance detection functions to convert existing objects into
|
|
100
100
|
// the corresponding refract elements.
|
package/src/Namespace.mjs
CHANGED
|
@@ -86,7 +86,7 @@ class Namespace {
|
|
|
86
86
|
*/
|
|
87
87
|
useDefault() {
|
|
88
88
|
// Set up classes for default elements
|
|
89
|
-
this.register('null', elements.NullElement).register('string', elements.StringElement).register('number', elements.NumberElement).register('boolean', elements.BooleanElement).register('array', elements.ArrayElement).register('object', elements.ObjectElement).register('member', elements.MemberElement).register('ref', elements.RefElement).register('link', elements.LinkElement).register('sourceMap', elements.SourceMapElement);
|
|
89
|
+
this.register('null', elements.NullElement).register('string', elements.StringElement).register('number', elements.NumberElement).register('boolean', elements.BooleanElement).register('array', elements.ArrayElement).register('object', elements.ObjectElement).register('member', elements.MemberElement).register('ref', elements.RefElement).register('link', elements.LinkElement).register('sourceMap', elements.SourceMapElement).register('annotation', elements.AnnotationElement).register('comment', elements.CommentElement).register('parseResult', elements.ParseResultElement);
|
|
90
90
|
|
|
91
91
|
// Add instance detection functions to convert existing objects into
|
|
92
92
|
// the corresponding refract elements.
|