@xylabs/threads 4.4.9 → 4.4.10
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/threads",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.10",
|
|
4
4
|
"description": "Web workers & worker threads as simple as a function call",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"@rollup/plugin-commonjs": "^28.0.1",
|
|
96
96
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
97
97
|
"@types/debug": "^4.1.12",
|
|
98
|
-
"@types/node": "^22.
|
|
98
|
+
"@types/node": "^22.10.0",
|
|
99
99
|
"@xylabs/ts-scripts-yarn3": "^4.2.4",
|
|
100
100
|
"cross-env": "^7.0.3",
|
|
101
101
|
"puppet-run": "^0.11.4",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"tiny-worker": "^2.3.0",
|
|
107
107
|
"tslib": "^2.8.1",
|
|
108
108
|
"typescript": "^5.7.2",
|
|
109
|
-
"vitest": "^2.1.
|
|
109
|
+
"vitest": "^2.1.6",
|
|
110
110
|
"webpack": "^5.96.1"
|
|
111
111
|
},
|
|
112
112
|
"optionalDependencies": {
|
|
@@ -22,8 +22,8 @@ function spyOn<Args extends any[], OriginalReturn, NewReturn>(
|
|
|
22
22
|
|
|
23
23
|
function replaceArrayBufferWithPlaceholder<In extends any>(
|
|
24
24
|
obj: In,
|
|
25
|
-
arrayBuffer:
|
|
26
|
-
): In extends
|
|
25
|
+
arrayBuffer: ArrayBufferLike,
|
|
26
|
+
): In extends ArrayBufferLike ? In | typeof arrayBufferPlaceholder : In {
|
|
27
27
|
if ((obj as any) === arrayBuffer) {
|
|
28
28
|
return arrayBufferPlaceholder as any
|
|
29
29
|
} else if (Array.isArray(obj)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expose, Transfer } from '../../src/worker'
|
|
2
2
|
|
|
3
|
-
function xor(buffer:
|
|
3
|
+
function xor(buffer: ArrayBufferLike, value: number) {
|
|
4
4
|
const view = new Uint8Array(buffer)
|
|
5
5
|
for (const [offset, byte] of view.entries()) view.set([byte ^ value], offset)
|
|
6
6
|
return Transfer(buffer)
|