@rrule-rust/lib-wasm32-wasi 2.1.0-alpha.2 → 2.1.0-alpha.4

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/package.json CHANGED
@@ -1,16 +1,14 @@
1
1
  {
2
2
  "name": "@rrule-rust/lib-wasm32-wasi",
3
- "version": "2.1.0-alpha.2",
4
- "cpu": [
5
- "wasm32"
6
- ],
3
+ "version": "2.1.0-alpha.4",
7
4
  "main": "rrule-rust.wasi.cjs",
8
5
  "files": [
9
6
  "rrule-rust.wasm32-wasi.wasm",
10
7
  "rrule-rust.wasi.cjs",
11
8
  "rrule-rust.wasi-browser.js",
12
9
  "wasi-worker.mjs",
13
- "wasi-worker-browser.mjs"
10
+ "wasi-worker-browser.mjs",
11
+ "patches/**/*"
14
12
  ],
15
13
  "author": {
16
14
  "name": "lsndr",
@@ -24,9 +22,13 @@
24
22
  "repository": "lsndr/rrule-rust",
25
23
  "browser": "rrule-rust.wasi-browser.js",
26
24
  "dependencies": {
27
- "@napi-rs/wasm-runtime": "^0.2.4"
25
+ "@napi-rs/wasm-runtime": "=0.2.4",
26
+ "patch-package": "^8.0.0"
28
27
  },
29
28
  "publishConfig": {
30
29
  "access": "public"
30
+ },
31
+ "scripts": {
32
+ "postinstall": "patch-package"
31
33
  }
32
34
  }
@@ -0,0 +1,28 @@
1
+ diff --git a/node_modules/@napi-rs/wasm-runtime/dist/runtime.js b/node_modules/@napi-rs/wasm-runtime/dist/runtime.js
2
+ index e06c158..a23882c 100644
3
+ --- a/node_modules/@napi-rs/wasm-runtime/dist/runtime.js
4
+ +++ b/node_modules/@napi-rs/wasm-runtime/dist/runtime.js
5
+ @@ -2532,7 +2532,22 @@ function createNapiModule(options) {
6
+ }
7
+ return str;
8
+ }
9
+ - return emnapiString.utf8Decoder.decode(((typeof SharedArrayBuffer === "function" && HEAPU8.buffer instanceof SharedArrayBuffer) || (Object.prototype.toString.call(HEAPU8.buffer.constructor) === "[object SharedArrayBuffer]")) ? HEAPU8.slice(ptr, end) : HEAPU8.subarray(ptr, end));
10
+ + var decodeFromSharedBuffer = (sharedBuffer) => {
11
+ + const decoder = new TextDecoder()
12
+ + const copyLength = sharedBuffer.byteLength
13
+ +
14
+ + const tempBuffer = new ArrayBuffer(copyLength)
15
+ + const tempView = new Uint8Array(tempBuffer)
16
+ +
17
+ + let sharedView = new Uint8Array(sharedBuffer)
18
+ + if (sharedBuffer.byteLength != copyLength) {
19
+ + sharedView = sharedView.subarray(0, copyLength)
20
+ + }
21
+ + tempView.set(sharedView)
22
+ +
23
+ + return decoder.decode(tempBuffer)
24
+ + }
25
+ + return decodeFromSharedBuffer(((typeof SharedArrayBuffer === "function" && HEAPU8.buffer instanceof SharedArrayBuffer) || (Object.prototype.toString.call(HEAPU8.buffer.constructor) === "[object SharedArrayBuffer]")) ? HEAPU8.slice(ptr, end) : HEAPU8.subarray(ptr, end));
26
+ },
27
+ stringToUTF8: function (str, outPtr, maxBytesToWrite) {
28
+ var HEAPU8 = new Uint8Array(wasmMemory.buffer);
Binary file