From f06956efd2dc4bf77244a9fcce2b883a00b925af Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 21 Dec 2023 22:46:53 +0800 Subject: updated node modules --- node_modules/fastq/.github/workflows/ci.yml | 33 +++++++++++++++++++++++++---- node_modules/fastq/index.d.ts | 1 + node_modules/fastq/package.json | 9 ++++---- node_modules/fastq/queue.js | 1 + node_modules/fastq/test/example.ts | 2 ++ node_modules/fastq/test/test.js | 16 ++++++++++++++ 6 files changed, 54 insertions(+), 8 deletions(-) (limited to 'node_modules/fastq') 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): 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"') + }) +}) -- cgit v1.2.3