vitest 0.0.114 → 0.0.118

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.
@@ -2,68 +2,6 @@ import { c as commonjsGlobal } from './_commonjsHelpers-c9e3b764.js';
2
2
  import assert$1 from 'assert';
3
3
  import require$$2 from 'events';
4
4
 
5
- var onetime$2 = {exports: {}};
6
-
7
- var mimicFn$2 = {exports: {}};
8
-
9
- const mimicFn$1 = (to, from) => {
10
- for (const prop of Reflect.ownKeys(from)) {
11
- Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
12
- }
13
-
14
- return to;
15
- };
16
-
17
- mimicFn$2.exports = mimicFn$1;
18
- // TODO: Remove this for the next major release
19
- mimicFn$2.exports.default = mimicFn$1;
20
-
21
- const mimicFn = mimicFn$2.exports;
22
-
23
- const calledFunctions = new WeakMap();
24
-
25
- const onetime = (function_, options = {}) => {
26
- if (typeof function_ !== 'function') {
27
- throw new TypeError('Expected a function');
28
- }
29
-
30
- let returnValue;
31
- let callCount = 0;
32
- const functionName = function_.displayName || function_.name || '<anonymous>';
33
-
34
- const onetime = function (...arguments_) {
35
- calledFunctions.set(onetime, ++callCount);
36
-
37
- if (callCount === 1) {
38
- returnValue = function_.apply(this, arguments_);
39
- function_ = null;
40
- } else if (options.throw === true) {
41
- throw new Error(`Function \`${functionName}\` can only be called once`);
42
- }
43
-
44
- return returnValue;
45
- };
46
-
47
- mimicFn(onetime, function_);
48
- calledFunctions.set(onetime, callCount);
49
-
50
- return onetime;
51
- };
52
-
53
- onetime$2.exports = onetime;
54
- // TODO: Remove this for the next major release
55
- onetime$2.exports.default = onetime;
56
-
57
- onetime$2.exports.callCount = function_ => {
58
- if (!calledFunctions.has(function_)) {
59
- throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
60
- }
61
-
62
- return calledFunctions.get(function_);
63
- };
64
-
65
- var onetime$1 = onetime$2.exports;
66
-
67
5
  var signalExit$1 = {exports: {}};
68
6
 
69
7
  var signals$1 = {exports: {}};
@@ -327,4 +265,66 @@ if (!processOk(process$1)) {
327
265
 
328
266
  var signalExit = signalExit$1.exports;
329
267
 
268
+ var onetime$2 = {exports: {}};
269
+
270
+ var mimicFn$2 = {exports: {}};
271
+
272
+ const mimicFn$1 = (to, from) => {
273
+ for (const prop of Reflect.ownKeys(from)) {
274
+ Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
275
+ }
276
+
277
+ return to;
278
+ };
279
+
280
+ mimicFn$2.exports = mimicFn$1;
281
+ // TODO: Remove this for the next major release
282
+ mimicFn$2.exports.default = mimicFn$1;
283
+
284
+ const mimicFn = mimicFn$2.exports;
285
+
286
+ const calledFunctions = new WeakMap();
287
+
288
+ const onetime = (function_, options = {}) => {
289
+ if (typeof function_ !== 'function') {
290
+ throw new TypeError('Expected a function');
291
+ }
292
+
293
+ let returnValue;
294
+ let callCount = 0;
295
+ const functionName = function_.displayName || function_.name || '<anonymous>';
296
+
297
+ const onetime = function (...arguments_) {
298
+ calledFunctions.set(onetime, ++callCount);
299
+
300
+ if (callCount === 1) {
301
+ returnValue = function_.apply(this, arguments_);
302
+ function_ = null;
303
+ } else if (options.throw === true) {
304
+ throw new Error(`Function \`${functionName}\` can only be called once`);
305
+ }
306
+
307
+ return returnValue;
308
+ };
309
+
310
+ mimicFn(onetime, function_);
311
+ calledFunctions.set(onetime, callCount);
312
+
313
+ return onetime;
314
+ };
315
+
316
+ onetime$2.exports = onetime;
317
+ // TODO: Remove this for the next major release
318
+ onetime$2.exports.default = onetime;
319
+
320
+ onetime$2.exports.callCount = function_ => {
321
+ if (!calledFunctions.has(function_)) {
322
+ throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
323
+ }
324
+
325
+ return calledFunctions.get(function_);
326
+ };
327
+
328
+ var onetime$1 = onetime$2.exports;
329
+
330
330
  export { signalExit$1 as a, onetime$2 as b, onetime$1 as o, signalExit as s };