@thi.ng/wasm-api-bindgen
Advanced tools
Comparing version 0.2.10 to 0.3.0
# Change Log | ||
- **Last updated**: 2023-01-10T15:20:19Z | ||
- **Last updated**: 2023-02-05T14:42:22Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -12,2 +12,13 @@ | ||
## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api-bindgen@0.3.0) (2023-02-05) | ||
#### 🚀 Features | ||
- add WasmType.instanceArray() impl ([f69d46e](https://github.com/thi-ng/umbrella/commit/f69d46e)) | ||
#### 🩹 Bug fixes | ||
- add missing Field.skip check ([ac43440](https://github.com/thi-ng/umbrella/commit/ac43440)) | ||
- update generateField() in TypeScript gen | ||
### [0.2.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api-bindgen@0.2.2) (2022-11-30) | ||
@@ -14,0 +25,0 @@ |
{ | ||
"name": "@thi.ng/wasm-api-bindgen", | ||
"version": "0.2.10", | ||
"version": "0.3.0", | ||
"description": "Polyglot bindings code generators for hybrid JS & WebAssembly projects", | ||
@@ -39,23 +39,23 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.6.3", | ||
"@thi.ng/args": "^2.2.16", | ||
"@thi.ng/arrays": "^2.5.1", | ||
"@thi.ng/binary": "^3.3.16", | ||
"@thi.ng/checks": "^3.3.7", | ||
"@thi.ng/compare": "^2.1.22", | ||
"@thi.ng/defmulti": "^2.1.27", | ||
"@thi.ng/errors": "^2.2.8", | ||
"@thi.ng/file-io": "^0.4.0", | ||
"@thi.ng/logger": "^1.4.7", | ||
"@thi.ng/paths": "^5.1.28", | ||
"@thi.ng/strings": "^3.3.23", | ||
"@thi.ng/wasm-api": "^1.2.7" | ||
"@thi.ng/api": "^8.7.0", | ||
"@thi.ng/args": "^2.2.17", | ||
"@thi.ng/arrays": "^2.5.2", | ||
"@thi.ng/binary": "^3.3.17", | ||
"@thi.ng/checks": "^3.3.8", | ||
"@thi.ng/compare": "^2.1.23", | ||
"@thi.ng/defmulti": "^2.1.28", | ||
"@thi.ng/errors": "^2.2.9", | ||
"@thi.ng/file-io": "^0.5.0", | ||
"@thi.ng/logger": "^1.4.8", | ||
"@thi.ng/paths": "^5.1.29", | ||
"@thi.ng/strings": "^3.3.24", | ||
"@thi.ng/wasm-api": "^1.3.0" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.33.7", | ||
"@thi.ng/testament": "^0.3.9", | ||
"rimraf": "^3.0.2", | ||
"@microsoft/api-extractor": "^7.34.2", | ||
"@thi.ng/testament": "^0.3.10", | ||
"rimraf": "^4.1.2", | ||
"tools": "^0.0.1", | ||
"typedoc": "^0.23.22", | ||
"typescript": "^4.9.4" | ||
"typedoc": "^0.23.24", | ||
"typescript": "^4.9.5" | ||
}, | ||
@@ -124,3 +124,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "3f0b3e2a7c82aefc7e46fb4338369836b5e1b8cf\n" | ||
"gitHead": "50ba9c87676fac60c46d2bc0e4d2c7711a374a68\n" | ||
} |
@@ -89,3 +89,3 @@ import { BIGINT_ARRAY_CTORS, BIT_SHIFTS, TYPEDARRAY_CTORS, } from "@thi.ng/api/typedarray"; | ||
// type implementation | ||
lines.push(`export const $${struct.name}: WasmTypeConstructor<${struct.name}> = (mem) => ({`, `get align() {`, `return ${struct.__align};`, `},`, `get size() {`, `return ${struct.__size};`, `},`, `instance: (base) => {`, ...pointerDecls, ...stringDecls, `return {`, `get __base() {`, `return base;`, `},`, `get __bytes() {`, `return mem.u8.subarray(base, base + ${struct.__size});`, `},`); | ||
lines.push(`export const $${struct.name}: WasmTypeConstructor<${struct.name}> = (mem) => ({`, `get align() {`, `return ${struct.__align};`, `},`, `get size() {`, `return ${struct.__size};`, `},`, `instanceArray(base, num) {`, `const items: ${struct.name}[] = [];`, `for (; num --> 0; base += ${struct.__size}) items.push(this.instance(base));`, `return items;`, `},`, `instance: (base) => {`, ...pointerDecls, ...stringDecls, `return {`, `get __base() {`, `return base;`, `},`, `get __bytes() {`, `return mem.u8.subarray(base, base + ${struct.__size});`, `},`); | ||
for (let f of fields) { | ||
@@ -181,2 +181,4 @@ if (!f) | ||
const generateField = (field, coll, opts) => { | ||
if (field.skip) | ||
return; | ||
if (isFuncPointer(field.type, coll) || isOpaque(field.type)) { | ||
@@ -183,0 +185,0 @@ field = { ...field, type: opts.target.usize }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137478
32
2450
+ Added@thi.ng/file-io@0.5.28(transitive)
- Removed@thi.ng/file-io@0.4.0(transitive)
Updated@thi.ng/api@^8.7.0
Updated@thi.ng/args@^2.2.17
Updated@thi.ng/arrays@^2.5.2
Updated@thi.ng/binary@^3.3.17
Updated@thi.ng/checks@^3.3.8
Updated@thi.ng/compare@^2.1.23
Updated@thi.ng/defmulti@^2.1.28
Updated@thi.ng/errors@^2.2.9
Updated@thi.ng/file-io@^0.5.0
Updated@thi.ng/logger@^1.4.8
Updated@thi.ng/paths@^5.1.29
Updated@thi.ng/strings@^3.3.24
Updated@thi.ng/wasm-api@^1.3.0