@tailwindcss/oxide-wasm32-wasi 4.3.2 → 4.3.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/README.md +1 -1
- package/node_modules/@emnapi/core/dist/emnapi-core.cjs.js +604 -477
- package/node_modules/@emnapi/core/dist/emnapi-core.cjs.min.d.ts +10 -1
- package/node_modules/@emnapi/core/dist/emnapi-core.cjs.min.js +1 -1
- package/node_modules/@emnapi/core/dist/emnapi-core.d.mts +10 -1
- package/node_modules/@emnapi/core/dist/emnapi-core.d.ts +10 -1
- package/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.js +704 -479
- package/node_modules/@emnapi/core/dist/emnapi-core.js +748 -481
- package/node_modules/@emnapi/core/dist/emnapi-core.min.d.mts +10 -1
- package/node_modules/@emnapi/core/dist/emnapi-core.min.js +1 -1
- package/node_modules/@emnapi/core/dist/emnapi-core.min.mjs +1 -1
- package/node_modules/@emnapi/core/dist/emnapi-core.mjs +604 -477
- package/node_modules/@emnapi/core/package.json +2 -2
- package/node_modules/@emnapi/runtime/dist/emnapi.cjs.js +22 -5
- package/node_modules/@emnapi/runtime/dist/emnapi.cjs.min.js +1 -1
- package/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js +24 -5
- package/node_modules/@emnapi/runtime/dist/emnapi.iife.js +24 -5
- package/node_modules/@emnapi/runtime/dist/emnapi.js +24 -5
- package/node_modules/@emnapi/runtime/dist/emnapi.min.js +1 -1
- package/node_modules/@emnapi/runtime/dist/emnapi.min.mjs +1 -1
- package/node_modules/@emnapi/runtime/dist/emnapi.mjs +22 -5
- package/node_modules/@emnapi/runtime/package.json +1 -1
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.js +32 -2
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.min.js +1 -1
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.esm-bundler.js +44 -2
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +44 -2
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.js +1 -1
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.mjs +1 -1
- package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.mjs +32 -2
- package/node_modules/@emnapi/wasi-threads/package.json +1 -1
- package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +1826 -0
- package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +1823 -0
- package/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +23 -1
- package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +1521 -1089
- package/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +23 -1
- package/node_modules/@napi-rs/wasm-runtime/package.json +13 -9
- package/node_modules/@napi-rs/wasm-runtime/runtime.cjs +26 -2
- package/node_modules/@napi-rs/wasm-runtime/runtime.js +32 -4
- package/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +60 -48
- package/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +60 -48
- package/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +1 -1
- package/node_modules/@tybys/wasm-util/dist/wasm-util.js +60 -48
- package/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +1 -1
- package/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +62 -49
- package/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +60 -48
- package/node_modules/@tybys/wasm-util/package.json +1 -1
- package/package.json +7 -10
- package/tailwindcss-oxide.wasi.cjs +18 -6
- package/tailwindcss-oxide.wasm32-wasi.wasm +0 -0
- package/wasi-worker.mjs +16 -7
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
const getType = (value) => {
|
|
9
9
|
if (value === undefined) return 0
|
|
10
10
|
if (value === null) return 1
|
|
11
|
+
if (isBuffer(value)) return 10
|
|
11
12
|
const t = typeof value;
|
|
12
13
|
if (t === 'boolean') return 2
|
|
13
14
|
if (t === 'number') return 3
|
|
@@ -17,6 +18,18 @@ const getType = (value) => {
|
|
|
17
18
|
return -1
|
|
18
19
|
};
|
|
19
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @param {unknown} value
|
|
23
|
+
* @returns {value is Uint8Array}
|
|
24
|
+
*/
|
|
25
|
+
const isBuffer = (value) => {
|
|
26
|
+
const BufferCtor = globalThis.Buffer;
|
|
27
|
+
if (typeof BufferCtor?.isBuffer === 'function') {
|
|
28
|
+
return BufferCtor.isBuffer(value)
|
|
29
|
+
}
|
|
30
|
+
return value instanceof Uint8Array && value.constructor?.name === 'Buffer'
|
|
31
|
+
};
|
|
32
|
+
|
|
20
33
|
const RESPONSE_HEADER_SIZE = 16;
|
|
21
34
|
const RESPONSE_PAYLOAD_SIZE = 10240;
|
|
22
35
|
const RESPONSE_BUFFER_SIZE = RESPONSE_HEADER_SIZE + RESPONSE_PAYLOAD_SIZE;
|
|
@@ -57,6 +70,8 @@ const encodeValue = (memfs, value, type) => {
|
|
|
57
70
|
const view = new TextEncoder().encode(value);
|
|
58
71
|
return view
|
|
59
72
|
}
|
|
73
|
+
case 10:
|
|
74
|
+
return new Uint8Array(value)
|
|
60
75
|
case 6: {
|
|
61
76
|
function storeConstructor(obj, memfs, processed = new WeakSet()) {
|
|
62
77
|
if (!obj || typeof obj !== 'object') {
|
|
@@ -128,6 +143,13 @@ const decodeValue = (memfs, payload, type) => {
|
|
|
128
143
|
if (type === 3)
|
|
129
144
|
return new Float64Array(payload.buffer, payload.byteOffset, 1)[0]
|
|
130
145
|
if (type === 4) return new TextDecoder().decode(payload.slice())
|
|
146
|
+
if (type === 10) {
|
|
147
|
+
const BufferCtor = globalThis.Buffer;
|
|
148
|
+
if (typeof BufferCtor?.from === 'function') {
|
|
149
|
+
return BufferCtor.from(payload)
|
|
150
|
+
}
|
|
151
|
+
return payload.slice()
|
|
152
|
+
}
|
|
131
153
|
if (type === 6) {
|
|
132
154
|
const obj = JSON.parse(
|
|
133
155
|
new TextDecoder().decode(payload.slice()),
|
|
@@ -207,7 +229,7 @@ const createOnMessage = (fs) =>
|
|
|
207
229
|
if (e.data.__fs__) {
|
|
208
230
|
/**
|
|
209
231
|
* 0..4 status(int32_t): 21(waiting) 0(success) 1(error)
|
|
210
|
-
* 5..8 type(napi_valuetype): 0(undefined) 1(null) 2(boolean) 3(number) 4(string) 6(jsonstring) 9(bigint) -1(unsupported)
|
|
232
|
+
* 5..8 type(napi_valuetype): 0(undefined) 1(null) 2(boolean) 3(number) 4(string) 6(jsonstring) 9(bigint) 10(buffer) -1(unsupported)
|
|
211
233
|
* 9..16 payload_size(uint32_t) <= 10240
|
|
212
234
|
* 16..16 + payload_size payload_content
|
|
213
235
|
*/
|