@jentic/arazzo-parser 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-parser
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-parser
@@ -3880,7 +3880,13 @@ class Element {
3880
3880
 
3881
3881
  /** Unique identifier for this element. */
3882
3882
  get id() {
3883
- return this.getMetaProperty('id', '');
3883
+ if (this.isFrozen) {
3884
+ return this.getMetaProperty('id', '');
3885
+ }
3886
+ if (!this.hasMetaProperty('id')) {
3887
+ this.setMetaProperty('id', '');
3888
+ }
3889
+ return this.meta.get('id');
3884
3890
  }
3885
3891
  set id(value) {
3886
3892
  this.setMetaProperty('id', value);
@@ -3888,7 +3894,13 @@ class Element {
3888
3894
 
3889
3895
  /** CSS-like class names. */
3890
3896
  get classes() {
3891
- return this.getMetaProperty('classes', []);
3897
+ if (this.isFrozen) {
3898
+ return this.getMetaProperty('classes', []);
3899
+ }
3900
+ if (!this.hasMetaProperty('classes')) {
3901
+ this.setMetaProperty('classes', []);
3902
+ }
3903
+ return this.meta.get('classes');
3892
3904
  }
3893
3905
  set classes(value) {
3894
3906
  this.setMetaProperty('classes', value);
@@ -3896,7 +3908,13 @@ class Element {
3896
3908
 
3897
3909
  /** Hyperlinks associated with this element. */
3898
3910
  get links() {
3899
- return this.getMetaProperty('links', []);
3911
+ if (this.isFrozen) {
3912
+ return this.getMetaProperty('links', []);
3913
+ }
3914
+ if (!this.hasMetaProperty('links')) {
3915
+ this.setMetaProperty('links', []);
3916
+ }
3917
+ return this.meta.get('links');
3900
3918
  }
3901
3919
  set links(value) {
3902
3920
  this.setMetaProperty('links', value);
@@ -4047,16 +4065,26 @@ class Element {
4047
4065
  }
4048
4066
 
4049
4067
  /**
4050
- * Gets a meta property, creating it with default value if not present.
4068
+ * Gets a meta property.
4069
+ *
4070
+ * When the property doesn't exist:
4071
+ * - With defaultValue: returns a new refracted element instance (not cached)
4072
+ * - Without defaultValue: returns undefined
4073
+ *
4074
+ * Note: Each call with a default creates a new instance. Use setMetaProperty
4075
+ * first if you need reference equality across multiple accesses.
4051
4076
  */
4077
+
4052
4078
  getMetaProperty(name, defaultValue) {
4053
- if (!this.meta.hasKey(name)) {
4054
- if (this.isFrozen) {
4055
- const element = this.refract(defaultValue);
4079
+ if (!this.hasMetaProperty(name)) {
4080
+ if (defaultValue === undefined) {
4081
+ return undefined;
4082
+ }
4083
+ const element = this.refract(defaultValue);
4084
+ if (element && this.isFrozen) {
4056
4085
  element.freeze();
4057
- return element;
4058
4086
  }
4059
- this.meta.set(name, defaultValue);
4087
+ return element;
4060
4088
  }
4061
4089
  return this.meta.get(name);
4062
4090
  }