Skip to content

Commit 85cdece

Browse files
committed
Require Node.js 22
1 parent 616306e commit 85cdece

3 files changed

Lines changed: 33 additions & 40 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13+
- 24
1314
- 22
14-
- 20
1515
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-node@v4
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-node@v6
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
- run: npm install

index.test-d.ts

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
11
import {expectType} from 'tsd';
22
import pRetry, {AbortError, type RetryContext} from './index.js';
33

4-
expectType<Promise<number>>(
5-
pRetry(async count => {
6-
expectType<number>(count);
7-
return 1;
8-
}),
9-
);
10-
expectType<Promise<void>>(
11-
pRetry(() => {}, { // eslint-disable-line @typescript-eslint/no-empty-function
12-
onFailedAttempt(context) {
13-
expectType<RetryContext>(context);
14-
expectType<number>(context.attemptNumber);
15-
expectType<number>(context.retriesLeft);
16-
expectType<number>(context.retriesConsumed);
17-
},
18-
}),
19-
);
20-
expectType<Promise<string>>(
21-
pRetry(() => 'foo', {
22-
retries: 5,
23-
}),
24-
);
4+
expectType<Promise<number>>(pRetry(async count => {
5+
expectType<number>(count);
6+
return 1;
7+
}));
8+
expectType<Promise<void>>(pRetry(() => {}, { // eslint-disable-line @typescript-eslint/no-empty-function
9+
onFailedAttempt(context) {
10+
expectType<RetryContext>(context);
11+
expectType<number>(context.attemptNumber);
12+
expectType<number>(context.retriesLeft);
13+
expectType<number>(context.retriesConsumed);
14+
},
15+
}));
16+
expectType<Promise<string>>(pRetry(() => 'foo', {
17+
retries: 5,
18+
}));
2519

26-
expectType<Promise<string>>(
27-
pRetry(async () => 'value', {
28-
async shouldConsumeRetry(context) {
29-
expectType<RetryContext>(context);
30-
expectType<Error>(context.error);
31-
return true;
32-
},
33-
minTimeout: 0,
34-
}),
35-
);
20+
expectType<Promise<string>>(pRetry(async () => 'value', {
21+
async shouldConsumeRetry(context) {
22+
expectType<RetryContext>(context);
23+
expectType<Error>(context.error);
24+
return true;
25+
},
26+
minTimeout: 0,
27+
}));
3628

3729
const abortError = new AbortError('foo');
3830
new AbortError(new Error('foo')); // eslint-disable-line no-new

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"sideEffects": false,
1919
"engines": {
20-
"node": ">=20"
20+
"node": ">=22"
2121
},
2222
"scripts": {
2323
"test": "xo && ava && tsd"
@@ -46,13 +46,14 @@
4646
"bluebird"
4747
],
4848
"dependencies": {
49-
"is-network-error": "^1.1.0"
49+
"is-network-error": "^1.3.0"
5050
},
5151
"devDependencies": {
52-
"ava": "^6.3.0",
53-
"delay": "^6.0.0",
54-
"tsd": "^0.32.0",
55-
"xo": "^0.60.0"
52+
"ava": "^6.4.1",
53+
"delay": "^7.0.0",
54+
"execa": "^9.6.1",
55+
"tsd": "^0.33.0",
56+
"xo": "^1.2.3"
5657
},
5758
"xo": {
5859
"rules": {

0 commit comments

Comments
 (0)