foxts 4.0.0 → 4.2.0
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/abort-error/index.d.ts +15 -0
- package/dist/abort-error/index.js +1 -0
- package/dist/abort-error/index.mjs +1 -0
- package/dist/async-retry/index.d.ts +82 -0
- package/dist/async-retry/index.js +1 -0
- package/dist/async-retry/index.mjs +1 -0
- package/dist/is-network-error/index.d.ts +3 -0
- package/dist/is-network-error/index.js +1 -0
- package/dist/is-network-error/index.mjs +1 -0
- package/dist/wait-until/index.d.ts +12 -0
- package/dist/wait-until/index.js +1 -0
- package/dist/wait-until/index.mjs +1 -0
- package/package.json +35 -6
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ErrorLikeObject } from '../extract-error-message/index.js';
|
|
2
|
+
|
|
3
|
+
interface AbortErrorLike extends Omit<ErrorLikeObject, 'name'> {
|
|
4
|
+
name: 'AbortError';
|
|
5
|
+
code?: 'ABORT_ERR';
|
|
6
|
+
}
|
|
7
|
+
declare class AbortError extends Error implements AbortErrorLike {
|
|
8
|
+
readonly name = "AbortError";
|
|
9
|
+
readonly code = "ABORT_ERR";
|
|
10
|
+
constructor(message?: string, options?: ErrorOptions);
|
|
11
|
+
}
|
|
12
|
+
declare function isAbortErrorLike(error: unknown): error is AbortErrorLike;
|
|
13
|
+
|
|
14
|
+
export { AbortError, isAbortErrorLike };
|
|
15
|
+
export type { AbortErrorLike };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=require("../extract-error-message/index.js");exports.AbortError=class extends Error{name="AbortError";code="ABORT_ERR";constructor(r="The operation was aborted",e){super(r,e)}},exports.isAbortErrorLike=function(e){return!!r.isErrorLikeObject(e)&&("AbortError"===e.name||"code"in e&&"string"==typeof e.code&&"ABORT_ERR"===e.code)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isErrorLikeObject as r}from"../extract-error-message/index.mjs";class o extends Error{name="AbortError";code="ABORT_ERR";constructor(r="The operation was aborted",o){super(r,o)}}function e(o){return!!r(o)&&("AbortError"===o.name||"code"in o&&"string"==typeof o.code&&"ABORT_ERR"===o.code)}export{o as AbortError,e as isAbortErrorLike};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
interface AsyncRetryContext {
|
|
2
|
+
readonly error: unknown;
|
|
3
|
+
readonly attemptNumber: number;
|
|
4
|
+
readonly retriesLeft: number;
|
|
5
|
+
}
|
|
6
|
+
interface AsyncRetryOptions {
|
|
7
|
+
/**
|
|
8
|
+
Callback invoked on each retry. Receives a context object containing the error and retry state information.
|
|
9
|
+
|
|
10
|
+
The `onFailedAttempt` function can return a promise. For example, to add extra delay, especially useful reading `Retry-After` header.
|
|
11
|
+
|
|
12
|
+
If the `onFailedAttempt` function throws, all retries will be aborted and the original promise will reject with the thrown error.
|
|
13
|
+
*/
|
|
14
|
+
onFailedAttempt?: (context: AsyncRetryContext) => void | Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `onFailedAttempt` instead. This is added only to be compatible with `async-retry`
|
|
17
|
+
*/
|
|
18
|
+
onRetry?: (error: unknown, attemptNumber: number) => void | Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
Decide if a retry should occur based on the context. Returning true triggers a retry, false aborts with the error.
|
|
21
|
+
|
|
22
|
+
It is only called if `retries` and `maxRetryTime` have not been exhausted.
|
|
23
|
+
It is not called for `TypeError` (except network errors) and `AbortError`.
|
|
24
|
+
|
|
25
|
+
In the example above, the operation will be retried unless the error is an instance of `CustomError`.
|
|
26
|
+
*/
|
|
27
|
+
shouldRetry?: (context: AsyncRetryContext) => boolean | Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use `retries` w/ `Number.POSITIVE_INFINITY` instead
|
|
30
|
+
*/
|
|
31
|
+
forever?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
The maximum amount of times to retry the operation.
|
|
34
|
+
@default 10
|
|
35
|
+
*/
|
|
36
|
+
retries?: number;
|
|
37
|
+
/**
|
|
38
|
+
The exponential factor to use.
|
|
39
|
+
@default 2
|
|
40
|
+
*/
|
|
41
|
+
factor?: number;
|
|
42
|
+
/**
|
|
43
|
+
The number of milliseconds before starting the first retry.
|
|
44
|
+
@default 1000
|
|
45
|
+
*/
|
|
46
|
+
minTimeout?: number;
|
|
47
|
+
/**
|
|
48
|
+
The maximum number of milliseconds between two retries.
|
|
49
|
+
@default Infinity
|
|
50
|
+
*/
|
|
51
|
+
maxTimeout?: number;
|
|
52
|
+
/**
|
|
53
|
+
Randomizes the timeouts by multiplying with a factor between 1 and 2.
|
|
54
|
+
@default true
|
|
55
|
+
*/
|
|
56
|
+
randomize?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
The maximum time (in milliseconds) that the retried operation is allowed to run.
|
|
59
|
+
@default Infinity
|
|
60
|
+
*/
|
|
61
|
+
maxRetryTime?: number;
|
|
62
|
+
/**
|
|
63
|
+
You can abort retrying using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).
|
|
64
|
+
*/
|
|
65
|
+
signal?: AbortSignal;
|
|
66
|
+
/**
|
|
67
|
+
Prevents retry timeouts from keeping the process alive.
|
|
68
|
+
Only affects platforms with a `.unref()` method on timeouts, such as Node.js.
|
|
69
|
+
@default false
|
|
70
|
+
*/
|
|
71
|
+
unref?: boolean;
|
|
72
|
+
}
|
|
73
|
+
declare class AsyncRetryAbortError extends Error {
|
|
74
|
+
name: string;
|
|
75
|
+
cause: unknown;
|
|
76
|
+
constructor(message: string | Error | unknown);
|
|
77
|
+
}
|
|
78
|
+
declare function asyncRetry<T>(callback: (bail: (reason?: unknown) => void, attemptNumber: number) => PromiseLike<T> | T, retryOptions?: AsyncRetryOptions): Promise<T>;
|
|
79
|
+
declare function makeRetriable<Args extends unknown[], Result>(fn: (...args: Args) => PromiseLike<Result> | Result, options?: AsyncRetryOptions): (this: unknown, ...args: Args) => Promise<Result>;
|
|
80
|
+
|
|
81
|
+
export { AsyncRetryAbortError, asyncRetry, makeRetriable };
|
|
82
|
+
export type { AsyncRetryContext, AsyncRetryOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=require("../abort-error/index.js"),t=require("../extract-error-message/index.js"),e=require("../is-network-error/index.js"),o=require("../noop/index.js");function i(r,t,{min:e=0,allowInfinity:o=!1}={}){if(Number.isNaN(t))throw TypeError(`Expected \`${r}\` to be a valid number${o?" or Infinity":""}, got NaN.`);if(!o&&!Number.isFinite(t))throw TypeError(`Expected \`${r}\` to be a finite number.`);if(t<e)throw TypeError(`Expected \`${r}\` to be \u2265 ${e}.`)}class n extends Error{name="AsyncRetryAbortError";cause;constructor(r){if(super("string"==typeof r?r:t.extractErrorMessage(r,!1)??"Aborted"),"string"==typeof r){const t=Error(r);t.stack=this.stack,this.cause=t}else r instanceof Error?(this.cause=r,this.message=r.message):this.cause=r}}async function a(t,o,i,a,s){if(t instanceof n)throw t.cause;if(t instanceof TypeError&&!e.isNetworkError(t)||r.isAbortErrorLike(t))throw t;const c=i.retries-(o-1),m={error:t,attemptNumber:o,retriesLeft:c};await i.onFailedAttempt(m),o>1&&await i.onRetry(t,o-1);const u=Date.now();if(u-a>=s||o>=i.retries+1||!await i.shouldRetry(m))throw t;let f=Math.round((i.randomize?Math.random()+1:1)*i.minTimeout*i.factor**(o-1));f=Math.min(f,i.maxTimeout);const l=s-(u-a);if(l<=0)throw t;const w=Math.min(f,l);w>0&&await new Promise((r,t)=>{const e=setTimeout(()=>{i.signal?.removeEventListener("abort",o),r()},w);function o(){clearTimeout(e),i.signal?.removeEventListener("abort",o),t(i.signal?.reason)}i.unref&&"object"==typeof e&&"unref"in e&&"function"==typeof e.unref&&e.unref(),i.signal?.addEventListener("abort",o,{once:!0})}),i.signal?.throwIfAborted()}function s(r){throw new n(r??"Aborted")}async function c(r,t={}){const e={...t};e.retries??=10,e.forever??=!1,e.factor??=2,e.minTimeout??=1e3,e.maxTimeout??=1/0,e.randomize??=!0,e.onFailedAttempt??=o.noop,e.onRetry??=o.noop,e.shouldRetry??=o.trueFn,e.forever&&(e.retries=1/0),i("retries",e.retries,{min:0,allowInfinity:!0}),i("factor",e.factor,{min:0,allowInfinity:!1}),i("minTimeout",e.minTimeout,{min:0,allowInfinity:!1}),i("maxTimeout",e.maxTimeout,{min:0,allowInfinity:!0});const m=e.maxRetryTime??1/0;i("maxRetryTime",m,{min:0,allowInfinity:!0}),e.minTimeout=Math.max(e.minTimeout,1),e.factor<=0&&(e.factor=1),e.signal?.throwIfAborted();let u=0;const f=Date.now();for(;u<e.retries+1;){u++;try{e.signal?.throwIfAborted();const t=await r(s,u);return e.signal?.throwIfAborted(),t}catch(t){let r=t;"object"==typeof t&&t&&"bail"in t&&t.bail&&(r=new n(t)),await a(r,u,e,f,m)}}throw Error("Retry attempts exhausted without throwing an error.")}exports.AsyncRetryAbortError=n,exports.asyncRetry=c,exports.makeRetriable=function(r,t){return function(...e){return c(()=>r.apply(this,e),t)}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isAbortErrorLike as t}from"../abort-error/index.mjs";import{extractErrorMessage as r}from"../extract-error-message/index.mjs";import{isNetworkError as e}from"../is-network-error/index.mjs";import{noop as o,trueFn as i}from"../noop/index.mjs";function n(t,r,{min:e=0,allowInfinity:o=!1}={}){if(Number.isNaN(r))throw TypeError(`Expected \`${t}\` to be a valid number${o?" or Infinity":""}, got NaN.`);if(!o&&!Number.isFinite(r))throw TypeError(`Expected \`${t}\` to be a finite number.`);if(r<e)throw TypeError(`Expected \`${t}\` to be \u2265 ${e}.`)}class a extends Error{name="AsyncRetryAbortError";cause;constructor(t){if(super("string"==typeof t?t:r(t,!1)??"Aborted"),"string"==typeof t){const r=Error(t);r.stack=this.stack,this.cause=r}else t instanceof Error?(this.cause=t,this.message=t.message):this.cause=t}}async function s(r,o,i,n,s){if(r instanceof a)throw r.cause;if(r instanceof TypeError&&!e(r)||t(r))throw r;const m=i.retries-(o-1),c={error:r,attemptNumber:o,retriesLeft:m};await i.onFailedAttempt(c),o>1&&await i.onRetry(r,o-1);const f=Date.now();if(f-n>=s||o>=i.retries+1||!await i.shouldRetry(c))throw r;let u=Math.round((i.randomize?Math.random()+1:1)*i.minTimeout*i.factor**(o-1));u=Math.min(u,i.maxTimeout);const l=s-(f-n);if(l<=0)throw r;const w=Math.min(u,l);w>0&&await new Promise((t,r)=>{const e=setTimeout(()=>{i.signal?.removeEventListener("abort",o),t()},w);function o(){clearTimeout(e),i.signal?.removeEventListener("abort",o),r(i.signal?.reason)}i.unref&&"object"==typeof e&&"unref"in e&&"function"==typeof e.unref&&e.unref(),i.signal?.addEventListener("abort",o,{once:!0})}),i.signal?.throwIfAborted()}function m(t){throw new a(t??"Aborted")}async function c(t,r={}){const e={...r};e.retries??=10,e.forever??=!1,e.factor??=2,e.minTimeout??=1e3,e.maxTimeout??=1/0,e.randomize??=!0,e.onFailedAttempt??=o,e.onRetry??=o,e.shouldRetry??=i,e.forever&&(e.retries=1/0),n("retries",e.retries,{min:0,allowInfinity:!0}),n("factor",e.factor,{min:0,allowInfinity:!1}),n("minTimeout",e.minTimeout,{min:0,allowInfinity:!1}),n("maxTimeout",e.maxTimeout,{min:0,allowInfinity:!0});const f=e.maxRetryTime??1/0;n("maxRetryTime",f,{min:0,allowInfinity:!0}),e.minTimeout=Math.max(e.minTimeout,1),e.factor<=0&&(e.factor=1),e.signal?.throwIfAborted();let u=0;const l=Date.now();for(;u<e.retries+1;){u++;try{e.signal?.throwIfAborted();const r=await t(m,u);return e.signal?.throwIfAborted(),r}catch(r){let t=r;"object"==typeof r&&r&&"bail"in r&&r.bail&&(t=new a(r)),await s(t,u,e,l,f)}}throw Error("Retry attempts exhausted without throwing an error.")}function f(t,r){return function(...e){return c(()=>t.apply(this,e),r)}}export{a as AsyncRetryAbortError,c as asyncRetry,f as makeRetriable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=Object.prototype.toString,r=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]),t=new Set(["ETIMEDOUT","ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET","UND_ERR_HEADERS_TIMEOUT"]);exports.isNetworkError=function(o){if("object"!=typeof o||null==o)return!1;if("code"in o&&"string"==typeof o.code){if("ERR_UNESCAPED_CHARACTERS"===o.code)return!1;if(t.has(o.code))return!0}if(!(o&&"[object Error]"===e.call(o)&&"TypeError"===o.name&&"string"==typeof o.message))return!1;const{message:n,stack:E}=o;return"Load failed"===n?void 0===E||"__sentry_captured__"in o:!!n.startsWith("error sending request for url")||r.has(n)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=Object.prototype.toString,r=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]),t=new Set(["ETIMEDOUT","ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET","UND_ERR_HEADERS_TIMEOUT"]);function o(o){if("object"!=typeof o||null==o)return!1;if("code"in o&&"string"==typeof o.code){if("ERR_UNESCAPED_CHARACTERS"===o.code)return!1;if(t.has(o.code))return!0}if(!(o&&"[object Error]"===e.call(o)&&"TypeError"===o.name&&"string"==typeof o.message))return!1;const{message:n,stack:E}=o;return"Load failed"===n?void 0===E||"__sentry_captured__"in o:!!n.startsWith("error sending request for url")||r.has(n)}export{o as isNetworkError};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type FalsyValue = null | undefined | false | '' | 0 | void;
|
|
2
|
+
type TruthyValue = Record<string, unknown> | unknown[] | symbol | ((..._args: unknown[]) => unknown) | Exclude<number, 0> | Exclude<string, ''> | true;
|
|
3
|
+
type CleanupFn = () => void;
|
|
4
|
+
type OnCleanup = (cleanUpFn: CleanupFn) => void;
|
|
5
|
+
type Scheduler = (callback: () => Promise<void>, onCleanup: OnCleanup) => void | CleanupFn;
|
|
6
|
+
type Predicate<T extends TruthyValue | FalsyValue> = () => T | Promise<T>;
|
|
7
|
+
declare function waitUntil<T extends TruthyValue | FalsyValue>(predicate: Predicate<T>, scheduler: Scheduler, abortSignal?: AbortSignal | null): Promise<T>;
|
|
8
|
+
declare function waitUntil<T extends TruthyValue | FalsyValue>(predicate: Predicate<T>, checkInterval?: number, abortSignal?: AbortSignal | null): Promise<T>;
|
|
9
|
+
declare function waitUntil<T extends TruthyValue | FalsyValue>(predicate: Predicate<T>, abortSignal: AbortSignal): Promise<T>;
|
|
10
|
+
|
|
11
|
+
export { waitUntil };
|
|
12
|
+
export type { CleanupFn, OnCleanup, Predicate, Scheduler };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.waitUntil=function(t,e=50,o=null){if("object"==typeof e&&"aborted"in e&&(o=e,e=50),"number"==typeof e){const t=e;e=(e,o)=>{const n=setTimeout(e,t);o(()=>clearTimeout(n))}}o??=AbortSignal.timeout(5e3);const n=new Set,r=t=>n.add(t);return new Promise((n,i)=>{const c=async()=>{try{o.throwIfAborted();const i=await t();if(i)return void n(i);e(c,r)}catch(t){i(t)}};c()}).finally(()=>{n.forEach(t=>t())})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(e,o=50,n=null){if("object"==typeof o&&"aborted"in o&&(n=o,o=50),"number"==typeof o){const t=o;o=(e,o)=>{const n=setTimeout(e,t);o(()=>clearTimeout(n))}}n??=AbortSignal.timeout(5e3);const r=new Set,i=t=>r.add(t);return new Promise((t,r)=>{const c=async()=>{try{n.throwIfAborted();const r=await e();if(r)return void t(r);o(c,i)}catch(t){r(t)}};c()}).finally(()=>{r.forEach(t=>t())})}export{t as waitUntil};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxts",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Opinionated collection of common TypeScript utils by @SukkaW",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/SukkaW/foxts"
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
"./package.json": "./package.json",
|
|
13
|
+
"./abort-error": {
|
|
14
|
+
"types": "./dist/abort-error/index.d.ts",
|
|
15
|
+
"import": "./dist/abort-error/index.mjs",
|
|
16
|
+
"require": "./dist/abort-error/index.js",
|
|
17
|
+
"default": "./dist/abort-error/index.js"
|
|
18
|
+
},
|
|
13
19
|
"./add-array-elements-to-set": {
|
|
14
20
|
"types": "./dist/add-array-elements-to-set/index.d.ts",
|
|
15
21
|
"import": "./dist/add-array-elements-to-set/index.mjs",
|
|
@@ -34,6 +40,12 @@
|
|
|
34
40
|
"require": "./dist/append-set-elements-to-array/index.js",
|
|
35
41
|
"default": "./dist/append-set-elements-to-array/index.js"
|
|
36
42
|
},
|
|
43
|
+
"./async-retry": {
|
|
44
|
+
"types": "./dist/async-retry/index.d.ts",
|
|
45
|
+
"import": "./dist/async-retry/index.mjs",
|
|
46
|
+
"require": "./dist/async-retry/index.js",
|
|
47
|
+
"default": "./dist/async-retry/index.js"
|
|
48
|
+
},
|
|
37
49
|
"./async-write-to-stream": {
|
|
38
50
|
"types": "./dist/async-write-to-stream/index.d.ts",
|
|
39
51
|
"import": "./dist/async-write-to-stream/index.mjs",
|
|
@@ -166,6 +178,12 @@
|
|
|
166
178
|
"require": "./dist/is-function/index.js",
|
|
167
179
|
"default": "./dist/is-function/index.js"
|
|
168
180
|
},
|
|
181
|
+
"./is-network-error": {
|
|
182
|
+
"types": "./dist/is-network-error/index.d.ts",
|
|
183
|
+
"import": "./dist/is-network-error/index.mjs",
|
|
184
|
+
"require": "./dist/is-network-error/index.js",
|
|
185
|
+
"default": "./dist/is-network-error/index.js"
|
|
186
|
+
},
|
|
169
187
|
"./is-probably-ip": {
|
|
170
188
|
"types": "./dist/is-probably-ip/index.d.ts",
|
|
171
189
|
"import": "./dist/is-probably-ip/index.mjs",
|
|
@@ -267,6 +285,12 @@
|
|
|
267
285
|
"import": "./dist/wait/index.mjs",
|
|
268
286
|
"require": "./dist/wait/index.js",
|
|
269
287
|
"default": "./dist/wait/index.js"
|
|
288
|
+
},
|
|
289
|
+
"./wait-until": {
|
|
290
|
+
"types": "./dist/wait-until/index.d.ts",
|
|
291
|
+
"import": "./dist/wait-until/index.mjs",
|
|
292
|
+
"require": "./dist/wait-until/index.js",
|
|
293
|
+
"default": "./dist/wait-until/index.js"
|
|
270
294
|
}
|
|
271
295
|
},
|
|
272
296
|
"sideEffects": false,
|
|
@@ -283,6 +307,7 @@
|
|
|
283
307
|
},
|
|
284
308
|
"devDependencies": {
|
|
285
309
|
"@eslint-sukka/node": "^7.2.1",
|
|
310
|
+
"@happy-dom/global-registrator": "^19.0.2",
|
|
286
311
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
287
312
|
"@mitata/counters": "^0.0.8",
|
|
288
313
|
"@monyone/aho-corasick": "^1.0.4",
|
|
@@ -290,28 +315,32 @@
|
|
|
290
315
|
"@swc-node/register": "^1.11.1",
|
|
291
316
|
"@swc/core": "^1.13.20",
|
|
292
317
|
"@types/mocha": "^10.0.10",
|
|
293
|
-
"@types/node": "^22.18.
|
|
318
|
+
"@types/node": "^22.18.8",
|
|
294
319
|
"@types/sinon": "^17.0.4",
|
|
295
320
|
"bumpp": "^10.2.3",
|
|
296
321
|
"devalue": "^5.3.2",
|
|
297
|
-
"eslint": "^9.
|
|
322
|
+
"eslint": "^9.37.0",
|
|
298
323
|
"eslint-config-sukka": "^7.2.1",
|
|
299
324
|
"eslint-formatter-sukka": "^7.2.1",
|
|
300
325
|
"expect": "^30.2.0",
|
|
301
326
|
"fastscan": "^1.0.6",
|
|
327
|
+
"happy-dom": "^19.0.2",
|
|
328
|
+
"is-ci": "^4.1.0",
|
|
329
|
+
"is-network-error": "^1.3.0",
|
|
302
330
|
"mitata": "^1.0.34",
|
|
303
|
-
"mocha": "^11.7.
|
|
331
|
+
"mocha": "^11.7.4",
|
|
304
332
|
"modern-ahocorasick": "^2.0.4",
|
|
305
333
|
"nyc": "^17.1.0",
|
|
306
|
-
"rollup": "^4.52.
|
|
334
|
+
"rollup": "^4.52.4",
|
|
307
335
|
"rollup-plugin-dts": "^6.2.3",
|
|
336
|
+
"rollup-plugin-oxc-resolve": "^0.0.4",
|
|
308
337
|
"rollup-plugin-swc3": "^0.12.1",
|
|
309
338
|
"sinon": "^21.0.0",
|
|
310
339
|
"word-list": "3.0.0"
|
|
311
340
|
},
|
|
312
341
|
"scripts": {
|
|
313
342
|
"lint": "eslint --format=sukka .",
|
|
314
|
-
"test": "SWC_NODE_IGNORE_DYNAMIC=1 SWC_NODE_INLINE_SOURCE_MAP=1 nyc mocha --require @swc-node/register --full-trace ./src/**/*.test.ts",
|
|
343
|
+
"test": "SWC_NODE_IGNORE_DYNAMIC=1 SWC_NODE_INLINE_SOURCE_MAP=1 nyc mocha --require @swc-node/register --parallel --full-trace ./src/**/*.test.ts",
|
|
315
344
|
"bench": "SWC_NODE_IGNORE_DYNAMIC=1 node --require @swc-node/register",
|
|
316
345
|
"bench:all": "SWC_NODE_IGNORE_DYNAMIC=1 node --require @swc-node/register ./src/**/*.bench.ts",
|
|
317
346
|
"build": "rollup -c rollup.config.ts --bundleConfigAsCjs --configPlugin swc3",
|