@rrule-rust/lib-wasm32-wasi 2.1.0-alpha.3 → 2.1.0-alpha.5

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,13 +1,15 @@
1
1
  {
2
2
  "name": "@rrule-rust/lib-wasm32-wasi",
3
- "version": "2.1.0-alpha.3",
3
+ "version": "2.1.0-alpha.5",
4
4
  "main": "rrule-rust.wasi.cjs",
5
5
  "files": [
6
6
  "rrule-rust.wasm32-wasi.wasm",
7
7
  "rrule-rust.wasi.cjs",
8
8
  "rrule-rust.wasi-browser.js",
9
9
  "wasi-worker.mjs",
10
- "wasi-worker-browser.mjs"
10
+ "runtime.js",
11
+ "wasi-worker-browser.mjs",
12
+ "patches/**/*"
11
13
  ],
12
14
  "author": {
13
15
  "name": "lsndr",
@@ -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);
@@ -3,7 +3,7 @@ import {
3
3
  getDefaultContext as __emnapiGetDefaultContext,
4
4
  WASI as __WASI,
5
5
  createOnMessage as __wasmCreateOnMessageForFsProxy,
6
- } from '@napi-rs/wasm-runtime'
6
+ } from './runtime.js'
7
7
 
8
8
  import __wasmUrl from './rrule-rust.wasm32-wasi.wasm?url'
9
9
 
@@ -12,7 +12,7 @@ const {
12
12
  instantiateNapiModuleSync: __emnapiInstantiateNapiModuleSync,
13
13
  getDefaultContext: __emnapiGetDefaultContext,
14
14
  createOnMessage: __wasmCreateOnMessageForFsProxy,
15
- } = require('@napi-rs/wasm-runtime')
15
+ } = frequire('./runtime.js')
16
16
 
17
17
  const __rootDir = __nodePath.parse(process.cwd()).root
18
18
 
Binary file
@@ -1,4 +1,4 @@
1
- import { instantiateNapiModuleSync, MessageHandler, WASI } from '@napi-rs/wasm-runtime'
1
+ import { instantiateNapiModuleSync, MessageHandler, WASI } from './runtime.js'
2
2
 
3
3
  const handler = new MessageHandler({
4
4
  onLoad({ wasmModule, wasmMemory }) {