@vitest/web-worker 0.31.1 → 0.31.3

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.
Files changed (2) hide show
  1. package/dist/pure.js +4 -25
  2. package/package.json +1 -1
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 {Record[]} serialized a previously serialized value.
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,35 +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 {any} value a serializable value.
251
- * @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that,
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[], json?: boolean, lossy?: boolean}?} options an object with
269
- * a transfer option (ignored when polyfilled) and/or non standard fields that
270
- * fallback to the polyfill if present.
271
- * @returns {Record[]}
272
- */
273
251
  var ponyfillStructuredClone = typeof structuredClone === "function" ?
274
252
  /* c8 ignore start */
275
253
  (any, options) => (
@@ -335,6 +313,7 @@ function getRunnerOptions() {
335
313
  moduleCache,
336
314
  mockMap,
337
315
  interopDefault: config.deps.interopDefault ?? true,
316
+ moduleDirectories: config.deps.moduleDirectories,
338
317
  root: config.root,
339
318
  base: config.base
340
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.1",
4
+ "version": "0.31.3",
5
5
  "description": "Web Worker support for testing in Vitest",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",