@jentic/arazzo-resolver 1.0.0-alpha.13 → 1.0.0-alpha.14

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
+ # [1.0.0-alpha.14](https://github.com/jentic/jentic-arazzo-tools/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2026-02-20)
7
+
8
+ **Note:** Version bump only for package @jentic/arazzo-resolver
9
+
6
10
  # [1.0.0-alpha.13](https://github.com/jentic/jentic-arazzo-tools/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2026-02-11)
7
11
 
8
12
  **Note:** Version bump only for package @jentic/arazzo-resolver
@@ -4601,7 +4601,13 @@ class Element {
4601
4601
 
4602
4602
  /** Unique identifier for this element. */
4603
4603
  get id() {
4604
- return this.getMetaProperty('id', '');
4604
+ if (this.isFrozen) {
4605
+ return this.getMetaProperty('id', '');
4606
+ }
4607
+ if (!this.hasMetaProperty('id')) {
4608
+ this.setMetaProperty('id', '');
4609
+ }
4610
+ return this.meta.get('id');
4605
4611
  }
4606
4612
  set id(value) {
4607
4613
  this.setMetaProperty('id', value);
@@ -4609,7 +4615,13 @@ class Element {
4609
4615
 
4610
4616
  /** CSS-like class names. */
4611
4617
  get classes() {
4612
- return this.getMetaProperty('classes', []);
4618
+ if (this.isFrozen) {
4619
+ return this.getMetaProperty('classes', []);
4620
+ }
4621
+ if (!this.hasMetaProperty('classes')) {
4622
+ this.setMetaProperty('classes', []);
4623
+ }
4624
+ return this.meta.get('classes');
4613
4625
  }
4614
4626
  set classes(value) {
4615
4627
  this.setMetaProperty('classes', value);
@@ -4617,7 +4629,13 @@ class Element {
4617
4629
 
4618
4630
  /** Hyperlinks associated with this element. */
4619
4631
  get links() {
4620
- return this.getMetaProperty('links', []);
4632
+ if (this.isFrozen) {
4633
+ return this.getMetaProperty('links', []);
4634
+ }
4635
+ if (!this.hasMetaProperty('links')) {
4636
+ this.setMetaProperty('links', []);
4637
+ }
4638
+ return this.meta.get('links');
4621
4639
  }
4622
4640
  set links(value) {
4623
4641
  this.setMetaProperty('links', value);
@@ -4768,16 +4786,26 @@ class Element {
4768
4786
  }
4769
4787
 
4770
4788
  /**
4771
- * Gets a meta property, creating it with default value if not present.
4789
+ * Gets a meta property.
4790
+ *
4791
+ * When the property doesn't exist:
4792
+ * - With defaultValue: returns a new refracted element instance (not cached)
4793
+ * - Without defaultValue: returns undefined
4794
+ *
4795
+ * Note: Each call with a default creates a new instance. Use setMetaProperty
4796
+ * first if you need reference equality across multiple accesses.
4772
4797
  */
4798
+
4773
4799
  getMetaProperty(name, defaultValue) {
4774
- if (!this.meta.hasKey(name)) {
4775
- if (this.isFrozen) {
4776
- const element = this.refract(defaultValue);
4800
+ if (!this.hasMetaProperty(name)) {
4801
+ if (defaultValue === undefined) {
4802
+ return undefined;
4803
+ }
4804
+ const element = this.refract(defaultValue);
4805
+ if (element && this.isFrozen) {
4777
4806
  element.freeze();
4778
- return element;
4779
4807
  }
4780
- this.meta.set(name, defaultValue);
4808
+ return element;
4781
4809
  }
4782
4810
  return this.meta.get(name);
4783
4811
  }