utilium 1.7.8 → 1.7.9

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/dist/struct.js CHANGED
@@ -91,7 +91,10 @@ export function struct(options = {}) {
91
91
  }
92
92
  context.metadata.struct = { options, members, staticSize };
93
93
  context.addInitializer(function () {
94
- this[Symbol.size] = _structSize.bind(this);
94
+ Object.defineProperty(this.prototype, Symbol.size, {
95
+ get: _structSize.bind(this),
96
+ enumerable: false,
97
+ });
95
98
  });
96
99
  return target;
97
100
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "1.7.8",
3
+ "version": "1.7.9",
4
4
  "description": "Typescript utilities",
5
5
  "funding": {
6
6
  "type": "individual",
package/src/struct.ts CHANGED
@@ -130,7 +130,10 @@ export function struct(options: Partial<Options> = {}) {
130
130
  context.metadata.struct = { options, members, staticSize } satisfies Metadata;
131
131
 
132
132
  context.addInitializer(function (this: any) {
133
- this[Symbol.size] = _structSize.bind(this);
133
+ Object.defineProperty(this.prototype, Symbol.size, {
134
+ get: _structSize.bind(this),
135
+ enumerable: false,
136
+ });
134
137
  });
135
138
 
136
139
  return target;