@speclynx/apidom-parser-adapter-yaml-1-2 2.10.3 → 2.11.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,10 @@
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
+ # [2.11.0](https://github.com/speclynx/apidom/compare/v2.10.3...v2.11.0) (2026-02-12)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-parser-adapter-yaml-1-2
9
+
6
10
  ## [2.10.3](https://github.com/speclynx/apidom/compare/v2.10.2...v2.10.3) (2026-02-10)
7
11
 
8
12
  **Note:** Version bump only for package @speclynx/apidom-parser-adapter-yaml-1-2
@@ -22325,7 +22325,13 @@ class Element {
22325
22325
 
22326
22326
  /** Unique identifier for this element. */
22327
22327
  get id() {
22328
- return this.getMetaProperty('id', '');
22328
+ if (this.isFrozen) {
22329
+ return this.getMetaProperty('id', '');
22330
+ }
22331
+ if (!this.hasMetaProperty('id')) {
22332
+ this.setMetaProperty('id', '');
22333
+ }
22334
+ return this.meta.get('id');
22329
22335
  }
22330
22336
  set id(value) {
22331
22337
  this.setMetaProperty('id', value);
@@ -22333,7 +22339,13 @@ class Element {
22333
22339
 
22334
22340
  /** CSS-like class names. */
22335
22341
  get classes() {
22336
- return this.getMetaProperty('classes', []);
22342
+ if (this.isFrozen) {
22343
+ return this.getMetaProperty('classes', []);
22344
+ }
22345
+ if (!this.hasMetaProperty('classes')) {
22346
+ this.setMetaProperty('classes', []);
22347
+ }
22348
+ return this.meta.get('classes');
22337
22349
  }
22338
22350
  set classes(value) {
22339
22351
  this.setMetaProperty('classes', value);
@@ -22341,7 +22353,13 @@ class Element {
22341
22353
 
22342
22354
  /** Hyperlinks associated with this element. */
22343
22355
  get links() {
22344
- return this.getMetaProperty('links', []);
22356
+ if (this.isFrozen) {
22357
+ return this.getMetaProperty('links', []);
22358
+ }
22359
+ if (!this.hasMetaProperty('links')) {
22360
+ this.setMetaProperty('links', []);
22361
+ }
22362
+ return this.meta.get('links');
22345
22363
  }
22346
22364
  set links(value) {
22347
22365
  this.setMetaProperty('links', value);
@@ -22492,16 +22510,26 @@ class Element {
22492
22510
  }
22493
22511
 
22494
22512
  /**
22495
- * Gets a meta property, creating it with default value if not present.
22513
+ * Gets a meta property.
22514
+ *
22515
+ * When the property doesn't exist:
22516
+ * - With defaultValue: returns a new refracted element instance (not cached)
22517
+ * - Without defaultValue: returns undefined
22518
+ *
22519
+ * Note: Each call with a default creates a new instance. Use setMetaProperty
22520
+ * first if you need reference equality across multiple accesses.
22496
22521
  */
22522
+
22497
22523
  getMetaProperty(name, defaultValue) {
22498
- if (!this.meta.hasKey(name)) {
22499
- if (this.isFrozen) {
22500
- const element = this.refract(defaultValue);
22524
+ if (!this.hasMetaProperty(name)) {
22525
+ if (defaultValue === undefined) {
22526
+ return undefined;
22527
+ }
22528
+ const element = this.refract(defaultValue);
22529
+ if (element && this.isFrozen) {
22501
22530
  element.freeze();
22502
- return element;
22503
22531
  }
22504
- this.meta.set(name, defaultValue);
22532
+ return element;
22505
22533
  }
22506
22534
  return this.meta.get(name);
22507
22535
  }