@vitest/web-worker 0.31.0 → 0.31.2
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/dist/pure.js +4 -24
- package/package.json +2 -2
package/dist/pure.js
CHANGED
@@ -92,14 +92,9 @@ const deserializer = ($, _) => {
|
|
92
92
|
return unpair;
|
93
93
|
};
|
94
94
|
|
95
|
-
/**
|
96
|
-
* @typedef {Array<string,any>} Record a type representation
|
97
|
-
*/
|
98
|
-
|
99
95
|
/**
|
100
96
|
* Returns a deserialized value from a serialized array of Records.
|
101
|
-
* @param
|
102
|
-
* @returns {any}
|
97
|
+
* @param serialized - a previously serialized value.
|
103
98
|
*/
|
104
99
|
const deserialize = serialized => deserializer(new Map, serialized)(0);
|
105
100
|
|
@@ -241,34 +236,18 @@ const serializer = (strict, json, $, _) => {
|
|
241
236
|
return pair;
|
242
237
|
};
|
243
238
|
|
244
|
-
/**
|
245
|
-
* @typedef {Array<string,any>} Record a type representation
|
246
|
-
*/
|
247
|
-
|
248
239
|
/**
|
249
240
|
* Returns an array of serialized Records.
|
250
|
-
* @param
|
251
|
-
* @param
|
241
|
+
* @param value - a serializable value.
|
242
|
+
* @param options - an object with a `lossy` property that,
|
252
243
|
* if `true`, will not throw errors on incompatible types, and behave more
|
253
244
|
* like JSON stringify would behave. Symbol and Function will be discarded.
|
254
|
-
* @returns {Record[]}
|
255
245
|
*/
|
256
246
|
const serialize = (value, {json, lossy} = {}) => {
|
257
247
|
const _ = [];
|
258
248
|
return serializer(!(json || lossy), !!json, new Map, _)(value), _;
|
259
249
|
};
|
260
250
|
|
261
|
-
/**
|
262
|
-
* @typedef {Array<string,any>} Record a type representation
|
263
|
-
*/
|
264
|
-
|
265
|
-
/**
|
266
|
-
* Returns an array of serialized Records.
|
267
|
-
* @param {any} any a serializable value.
|
268
|
-
* @param {{transfer: any[]}?} options an object with a transfoer property.
|
269
|
-
* This is currently not supported, all values are always cloned.
|
270
|
-
* @returns {Record[]}
|
271
|
-
*/
|
272
251
|
var ponyfillStructuredClone = typeof structuredClone === "function" ?
|
273
252
|
/* c8 ignore start */
|
274
253
|
(any, options) => (
|
@@ -334,6 +313,7 @@ function getRunnerOptions() {
|
|
334
313
|
moduleCache,
|
335
314
|
mockMap,
|
336
315
|
interopDefault: config.deps.interopDefault ?? true,
|
316
|
+
moduleDirectories: config.deps.moduleDirectories,
|
337
317
|
root: config.root,
|
338
318
|
base: config.base
|
339
319
|
};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vitest/web-worker",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.31.
|
4
|
+
"version": "0.31.2",
|
5
5
|
"description": "Web Worker support for testing in Vitest",
|
6
6
|
"license": "MIT",
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
@@ -43,7 +43,7 @@
|
|
43
43
|
"devDependencies": {
|
44
44
|
"@types/debug": "^4.1.7",
|
45
45
|
"@types/ungap__structured-clone": "^0.3.0",
|
46
|
-
"@ungap/structured-clone": "^1.0
|
46
|
+
"@ungap/structured-clone": "^1.1.0"
|
47
47
|
},
|
48
48
|
"scripts": {
|
49
49
|
"build": "rimraf dist && rollup -c",
|