summaryrefslogtreecommitdiff
path: root/node_modules/fastq
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-12-21 22:46:53 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-12-21 22:46:53 +0800
commitf06956efd2dc4bf77244a9fcce2b883a00b925af (patch)
tree0123cb73ce67f1f4b17e1d6cbabff076ee44e31b /node_modules/fastq
parent8d980c13970c15b6d2312b6fc4ac51698dd0d220 (diff)
updated node modules
Diffstat (limited to 'node_modules/fastq')
-rw-r--r--node_modules/fastq/.github/workflows/ci.yml33
-rw-r--r--node_modules/fastq/index.d.ts1
-rw-r--r--node_modules/fastq/package.json9
-rw-r--r--node_modules/fastq/queue.js1
-rw-r--r--node_modules/fastq/test/example.ts2
-rw-r--r--node_modules/fastq/test/test.js16
6 files changed, 54 insertions, 8 deletions
diff --git a/node_modules/fastq/.github/workflows/ci.yml b/node_modules/fastq/.github/workflows/ci.yml
index 50e66b5e..69521c4d 100644
--- a/node_modules/fastq/.github/workflows/ci.yml
+++ b/node_modules/fastq/.github/workflows/ci.yml
@@ -11,7 +11,9 @@ jobs:
node-version: ['0.10', '0.12', 4.x, 6.x, 8.x]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
+ with:
+ persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v1
@@ -31,13 +33,15 @@ jobs:
strategy:
matrix:
- node-version: [10.x, 12.x, 13.x, 14.x, 15.x, 16.x]
+ node-version: [10.x, 12.x, 13.x, 14.x, 15.x, 16.x, 18.x, 20.x]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
+ with:
+ persist-credentials: false
- name: Use Node.js
- uses: actions/setup-node@v1
+ uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
@@ -48,3 +52,24 @@ jobs:
- name: Run tests
run: |
npm run test
+
+ types:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+
+ - name: Use Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16
+
+ - name: Install
+ run: |
+ npm install
+
+ - name: Run types tests
+ run: |
+ npm run typescript
diff --git a/node_modules/fastq/index.d.ts b/node_modules/fastq/index.d.ts
index 65ebe658..327f399a 100644
--- a/node_modules/fastq/index.d.ts
+++ b/node_modules/fastq/index.d.ts
@@ -12,6 +12,7 @@ declare namespace fastq {
unshift(task: T, done?: done<R>): void
pause(): any
resume(): any
+ running(): number
idle(): boolean
length(): number
getQueue(): T[]
diff --git a/node_modules/fastq/package.json b/node_modules/fastq/package.json
index bf572e31..d0a20e0e 100644
--- a/node_modules/fastq/package.json
+++ b/node_modules/fastq/package.json
@@ -1,6 +1,6 @@
{
"name": "fastq",
- "version": "1.15.0",
+ "version": "1.16.0",
"description": "Fast, in memory work queue",
"main": "queue.js",
"scripts": {
@@ -8,12 +8,13 @@
"unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test/test.js test/promise.js",
"coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js test/promise.js",
"test:report": "npm run lint && npm run unit:report",
- "test": "npm run lint && npm run unit && npm run typescript",
+ "test": "npm run lint && npm run unit",
"typescript": "tsc --project ./test/tsconfig.json",
"legacy": "tape test/test.js"
},
"pre-commit": [
- "test"
+ "test",
+ "typescript"
],
"repository": {
"type": "git",
@@ -39,7 +40,7 @@
"snazzy": "^9.0.0",
"standard": "^16.0.0",
"tape": "^5.0.0",
- "typescript": "^4.0.2"
+ "typescript": "^5.0.4"
},
"dependencies": {
"reusify": "^1.0.4"
diff --git a/node_modules/fastq/queue.js b/node_modules/fastq/queue.js
index 03fe1127..d5a8406d 100644
--- a/node_modules/fastq/queue.js
+++ b/node_modules/fastq/queue.js
@@ -118,6 +118,7 @@ function fastqueue (context, worker, concurrency) {
current.release = release
current.value = value
current.callback = done || noop
+ current.errorHandler = errorHandler
if (_running === self.concurrency || self.paused) {
if (queueHead) {
diff --git a/node_modules/fastq/test/example.ts b/node_modules/fastq/test/example.ts
index c454e9d0..a47d4419 100644
--- a/node_modules/fastq/test/example.ts
+++ b/node_modules/fastq/test/example.ts
@@ -32,6 +32,8 @@ queue.pause()
queue.resume()
+queue.running()
+
queue.saturated = () => undefined
queue.unshift('world', (err, result) => {
diff --git a/node_modules/fastq/test/test.js b/node_modules/fastq/test/test.js
index 1cc78a56..accbaf94 100644
--- a/node_modules/fastq/test/test.js
+++ b/node_modules/fastq/test/test.js
@@ -564,3 +564,19 @@ test('push with worker throwing error', function (t) {
t.match(err.message, /test error/, 'error message should be "test error"')
})
})
+
+test('unshift with worker throwing error', function (t) {
+ t.plan(5)
+ var q = buildQueue(function (task, cb) {
+ cb(new Error('test error'), null)
+ }, 1)
+ q.error(function (err, task) {
+ t.ok(err instanceof Error, 'global error handler should catch the error')
+ t.match(err.message, /test error/, 'error message should be "test error"')
+ t.equal(task, 42, 'The task executed should be passed')
+ })
+ q.unshift(42, function (err) {
+ t.ok(err instanceof Error, 'unshift callback should catch the error')
+ t.match(err.message, /test error/, 'error message should be "test error"')
+ })
+})