@speclynx/apidom-ns-openapi-3-1 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-ns-openapi-3-1
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-ns-openapi-3-1
@@ -23911,7 +23911,13 @@ class Element {
23911
23911
 
23912
23912
  /** Unique identifier for this element. */
23913
23913
  get id() {
23914
- return this.getMetaProperty('id', '');
23914
+ if (this.isFrozen) {
23915
+ return this.getMetaProperty('id', '');
23916
+ }
23917
+ if (!this.hasMetaProperty('id')) {
23918
+ this.setMetaProperty('id', '');
23919
+ }
23920
+ return this.meta.get('id');
23915
23921
  }
23916
23922
  set id(value) {
23917
23923
  this.setMetaProperty('id', value);
@@ -23919,7 +23925,13 @@ class Element {
23919
23925
 
23920
23926
  /** CSS-like class names. */
23921
23927
  get classes() {
23922
- return this.getMetaProperty('classes', []);
23928
+ if (this.isFrozen) {
23929
+ return this.getMetaProperty('classes', []);
23930
+ }
23931
+ if (!this.hasMetaProperty('classes')) {
23932
+ this.setMetaProperty('classes', []);
23933
+ }
23934
+ return this.meta.get('classes');
23923
23935
  }
23924
23936
  set classes(value) {
23925
23937
  this.setMetaProperty('classes', value);
@@ -23927,7 +23939,13 @@ class Element {
23927
23939
 
23928
23940
  /** Hyperlinks associated with this element. */
23929
23941
  get links() {
23930
- return this.getMetaProperty('links', []);
23942
+ if (this.isFrozen) {
23943
+ return this.getMetaProperty('links', []);
23944
+ }
23945
+ if (!this.hasMetaProperty('links')) {
23946
+ this.setMetaProperty('links', []);
23947
+ }
23948
+ return this.meta.get('links');
23931
23949
  }
23932
23950
  set links(value) {
23933
23951
  this.setMetaProperty('links', value);
@@ -24078,16 +24096,26 @@ class Element {
24078
24096
  }
24079
24097
 
24080
24098
  /**
24081
- * Gets a meta property, creating it with default value if not present.
24099
+ * Gets a meta property.
24100
+ *
24101
+ * When the property doesn't exist:
24102
+ * - With defaultValue: returns a new refracted element instance (not cached)
24103
+ * - Without defaultValue: returns undefined
24104
+ *
24105
+ * Note: Each call with a default creates a new instance. Use setMetaProperty
24106
+ * first if you need reference equality across multiple accesses.
24082
24107
  */
24108
+
24083
24109
  getMetaProperty(name, defaultValue) {
24084
- if (!this.meta.hasKey(name)) {
24085
- if (this.isFrozen) {
24086
- const element = this.refract(defaultValue);
24110
+ if (!this.hasMetaProperty(name)) {
24111
+ if (defaultValue === undefined) {
24112
+ return undefined;
24113
+ }
24114
+ const element = this.refract(defaultValue);
24115
+ if (element && this.isFrozen) {
24087
24116
  element.freeze();
24088
- return element;
24089
24117
  }
24090
- this.meta.set(name, defaultValue);
24118
+ return element;
24091
24119
  }
24092
24120
  return this.meta.get(name);
24093
24121
  }