@thi.ng/wasm-api 2.2.0 → 2.2.1

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
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-11-10T17:11:51Z
3
+ - **Last updated**: 2024-11-10T18:20:49Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [2.2.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api@2.2.1) (2024-11-10)
13
+
14
+ #### 🩹 Bug fixes
15
+
16
+ - fix defType() property handling ([37bebee](https://github.com/thi-ng/umbrella/commit/37bebee))
17
+ - inject `__base` and `__bytes` getters using `Object.defineProperties()`
18
+
12
19
  ## [2.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api@2.2.0) (2024-11-10)
13
20
 
14
21
  #### 🚀 Features
package/deftype.js CHANGED
@@ -9,15 +9,18 @@ const defType = (align, size, instance) => (mem) => ({
9
9
  instanceArray(base, num) {
10
10
  return __instanceArray(this, base, num);
11
11
  },
12
- instance: (base) => ({
13
- get __base() {
14
- return base;
15
- },
16
- get __bytes() {
17
- return mem.u8.subarray(base, base + size);
18
- },
19
- ...instance(mem, base)
20
- })
12
+ instance: (base) => {
13
+ const inst = instance(mem, base);
14
+ Object.defineProperties(inst, {
15
+ __base: { value: base },
16
+ __bytes: {
17
+ get() {
18
+ return mem.u8.subarray(base, base + size);
19
+ }
20
+ }
21
+ });
22
+ return inst;
23
+ }
21
24
  });
22
25
  export {
23
26
  defType
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/wasm-api",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -124,5 +124,5 @@
124
124
  "status": "alpha",
125
125
  "year": 2022
126
126
  },
127
- "gitHead": "ef89090bb19fc5bca23be5da8cfce05b82ff4ad1\n"
127
+ "gitHead": "49023d7517c20e18bc0612051059f9f971372b4c\n"
128
128
  }