diff --git a/package.json b/package.json index 3765a62..7378494 100644 --- a/package.json +++ b/package.json @@ -44,13 +44,13 @@ ], "dependencies": { "eventemitter3": "^4.0.7", - "p-timeout": "^5.0.0" + "p-timeout": "^5.0.2" }, "devDependencies": { "@sindresorhus/tsconfig": "^2.0.0", "@types/benchmark": "^2.1.1", - "@types/node": "^16.7.2", - "ava": "^3.15.0", + "@types/node": "^17.0.13", + "ava": "^4.0.1", "benchmark": "^2.1.4", "codecov": "^3.8.3", "del-cli": "^4.0.1", @@ -59,8 +59,8 @@ "nyc": "^15.1.0", "random-int": "^3.0.0", "time-span": "^5.0.0", - "ts-node": "^10.2.1", - "typescript": "^4.4.2", + "ts-node": "^10.4.0", + "typescript": "^4.5.5", "xo": "^0.44.0" }, "ava": { @@ -70,9 +70,6 @@ "extensions": { "ts": "module" }, - "nonSemVerExperiments": { - "configurableModuleFormat": true - }, "nodeArguments": [ "--loader=ts-node/esm" ] diff --git a/readme.md b/readme.md index a5c72fd..2a75ea3 100644 --- a/readme.md +++ b/readme.md @@ -133,6 +133,8 @@ Priority of operation. Operations with greater priority will be scheduled first. ##### signal +*Requires Node.js 16 or later.* + [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) for cancellation of the operation. When aborted, it will be removed from the queue and the `queue.add()` call will reject with an `AbortError`. If the operation is already running, the signal will need to be handled by the operation itself. ```js diff --git a/test/test.ts b/test/test.ts index 878e000..1aaa58d 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1065,7 +1065,6 @@ test('should verify timeout overrides passed to add', async t => { test('should skip an aborted job', async t => { const queue = new PQueue(); - const controller = new AbortController(); controller.abort(); @@ -1077,10 +1076,9 @@ test('should skip an aborted job', async t => { test('should pass AbortSignal instance to job', async t => { const queue = new PQueue(); - const controller = new AbortController(); await queue.add(async ({signal}) => { - t.is(controller.signal, signal); + t.is(controller.signal, signal!); }, {signal: controller.signal}); });