Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thi.ng/wasm-api

Package Overview
Dependencies
Maintainers
1
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/wasm-api - npm Package Compare versions

Comparing version 0.18.0 to 0.18.1

10

CHANGELOG.md
# Change Log
- **Last updated**: 2022-10-31T23:01:45Z
- **Last updated**: 2022-11-01T12:32:51Z
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)

@@ -12,2 +12,10 @@

### [0.18.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api@0.18.1) (2022-11-01)
#### 🩹 Bug fixes
- fix TS code gen array mem mapping ([a0e7132](https://github.com/thi-ng/umbrella/commit/a0e7132))
- use correct type size for array mem mapping
- update test fixtures
## [0.18.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api@0.18.0) (2022-10-31)

@@ -14,0 +22,0 @@

16

codegen/typescript.js

@@ -23,3 +23,3 @@ import { BIGINT_ARRAY_CTORS, BIT_SHIFTS, TYPEDARRAY_CTORS, } from "@thi.ng/api/typedarray";

};
const SCOPES = [/\{$/, /\}\)?[;,]?$/];
const SCOPES = [/\{$/, /(?<!\{.*)\}\)?[;,]?$/];
const gen = {

@@ -110,3 +110,7 @@ pre: (opts) => `// @ts-ignore possibly includes unused imports

const fn = f.len
? [`(addr) => {`, ...__mapArray(f, f.len), `}`]
? [
`(addr) => {`,
...__mapArray(f, types, f.len),
`}`,
]
: [`(addr) => new $${f.type}.instance(addr)`];

@@ -125,3 +129,3 @@ lines.push(`return $${f.name} || ($${f.name} = new ${ftype}(mem, ${__addr(offset)},`, ...fn, `));`);

else {
lines.push(`const addr = ${__ptr(opts.target, offset)};`, ...__mapArray(f));
lines.push(`const addr = ${__ptr(opts.target, offset)};`, ...__mapArray(f, types));
}

@@ -137,3 +141,3 @@ }

else {
lines.push(`const addr = ${__addr(offset)};`, ...__mapArray(f, f.len));
lines.push(`const addr = ${__addr(offset)};`, ...__mapArray(f, types, f.len));
}

@@ -224,6 +228,6 @@ }

/** @internal */
const __mapArray = (f, len = "len") => [
const __mapArray = (f, types, len = "len") => [
`const inst = $${f.type}(mem);`,
`const slice: ${f.type}[] = [];`,
`for(let i = 0; i < ${len}; i++) slice.push(inst.instance(addr + i * ${f.__size}));`,
`for(let i = 0; i < ${len}; i++) slice.push(inst.instance(addr + i * ${types[f.type].__size}));`,
`return slice;`,

@@ -230,0 +234,0 @@ ];

@@ -17,3 +17,3 @@ import { isNumber } from "@thi.ng/checks";

const INDENT = " ";
const SCOPES = [/\{$/, /\}\)?[;,]?$/];
const SCOPES = [/\{$/, /(?<!\{.*)\}\)?[;,]?$/];
const gen = {

@@ -20,0 +20,0 @@ pre: () => `const std = @import("std");${opts.pre ? `\n${opts.pre}` : ""}`,

{
"name": "@thi.ng/wasm-api",
"version": "0.18.0",
"version": "0.18.1",
"description": "Generic, modular, extensible API bridge, polyglot glue code and bindings code generators for hybrid JS & WebAssembly projects",

@@ -39,16 +39,16 @@ "type": "module",

"dependencies": {
"@thi.ng/api": "^8.4.4",
"@thi.ng/args": "^2.2.7",
"@thi.ng/arrays": "^2.4.0",
"@thi.ng/binary": "^3.3.8",
"@thi.ng/api": "^8.4.5",
"@thi.ng/args": "^2.2.8",
"@thi.ng/arrays": "^2.4.1",
"@thi.ng/binary": "^3.3.9",
"@thi.ng/checks": "^3.3.2",
"@thi.ng/compare": "^2.1.14",
"@thi.ng/defmulti": "^2.1.19",
"@thi.ng/compare": "^2.1.15",
"@thi.ng/defmulti": "^2.1.20",
"@thi.ng/errors": "^2.2.3",
"@thi.ng/file-io": "^0.3.17",
"@thi.ng/file-io": "^0.3.18",
"@thi.ng/hex": "^2.2.2",
"@thi.ng/idgen": "^2.1.16",
"@thi.ng/idgen": "^2.1.17",
"@thi.ng/logger": "^1.4.2",
"@thi.ng/paths": "^5.1.20",
"@thi.ng/strings": "^3.3.15"
"@thi.ng/paths": "^5.1.21",
"@thi.ng/strings": "^3.3.16"
},

@@ -146,3 +146,3 @@ "devDependencies": {

},
"gitHead": "7eff3051eb395f460421727b8cf5ef79f09faaa9\n"
"gitHead": "a4b60163a8caddceed5ec1b6b3584d164f61e7b6\n"
}

@@ -691,3 +691,3 @@ <!-- This file is generated - DO NOT EDIT! -->

Package sizes (gzipped, pre-treeshake): ESM: 7.13 KB
Package sizes (gzipped, pre-treeshake): ESM: 7.14 KB

@@ -694,0 +694,0 @@ **IMPORTANT:** The package includes multiple language code generators which are

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc