From 9d79c9a1a9f66086ec17b2850acb7dfaca024c89 Mon Sep 17 00:00:00 2001 From: sttk Date: Wed, 17 Nov 2021 16:09:53 +0900 Subject: [PATCH 1/5] chore!: Normalize repository, dropping node <10.13 support --- .ci/.azure-pipelines-steps.yml | 38 -------------- .ci/.azure-pipelines.yml | 90 ---------------------------------- .eslintignore | 1 + .github/workflows/dev.yml | 75 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 17 +++++++ .gitignore | 2 +- .prettierignore | 3 ++ .travis.yml | 12 ----- LICENSE | 2 +- README.md | 27 ++++------ appveyor.yml | 32 ------------ index.d.ts | 2 +- package.json | 46 ++++++++++------- test/.eslintrc | 3 -- test/callbacks.js | 4 +- test/child_processes.js | 8 +-- test/observables.js | 12 ++--- test/promises.js | 8 +-- test/streams.js | 16 +++--- test/types/observables.ts | 8 +-- 20 files changed, 166 insertions(+), 240 deletions(-) delete mode 100644 .ci/.azure-pipelines-steps.yml delete mode 100644 .ci/.azure-pipelines.yml create mode 100644 .eslintignore create mode 100644 .github/workflows/dev.yml create mode 100644 .github/workflows/release.yml create mode 100644 .prettierignore delete mode 100644 .travis.yml delete mode 100644 appveyor.yml delete mode 100644 test/.eslintrc diff --git a/.ci/.azure-pipelines-steps.yml b/.ci/.azure-pipelines-steps.yml deleted file mode 100644 index 894c21e..0000000 --- a/.ci/.azure-pipelines-steps.yml +++ /dev/null @@ -1,38 +0,0 @@ -steps: -- script: npm i -g npm@$(npm_version) - displayName: Use legacy npm version $(npm_version) - condition: ne(variables['npm_version'], '') - -- task: NodeTool@0 - inputs: - versionSpec: '$(node_version)' - displayName: Use Node $(node_version) - -- script: npm install - displayName: npm install - -- script: npm test - displayName: Run tests - -- script: npm run coveralls - displayName: Run coveralls - env: - # Pretend to be AppVeyor for now - APPVEYOR: true - APPVEYOR_BUILD_NUMBER: $(Build.BuildNumber) - APPVEYOR_BUILD_ID: $(Agent.OS)_$(node_version) - APPVEYOR_REPO_COMMIT: $(Build.SourceVersion) - APPVEYOR_REPO_BRANCH: $(Build.SourceBranchName) - # Overwrite the AppVeyor Service Name - COVERALLS_SERVICE_NAME: Azure Pipelines - COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET) - COVERALLS_PARALLEL: true - CI_PULL_REQUEST: $(System.PullRequest.PullRequestNumber) - -- script: npm run azure-pipelines - displayName: Write tests to xml - -- task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test.xunit' - condition: succeededOrFailed() diff --git a/.ci/.azure-pipelines.yml b/.ci/.azure-pipelines.yml deleted file mode 100644 index 2d717af..0000000 --- a/.ci/.azure-pipelines.yml +++ /dev/null @@ -1,90 +0,0 @@ -trigger: -- master -- releases/* - -jobs: - - job: Test_Linux - displayName: Run Tests on Linux - pool: - vmImage: "Ubuntu 16.04" - strategy: - matrix: - Node_v12: - node_version: 12 - Node_v10: - node_version: 10 - Node_v8: - node_version: 8 - Node_v6: - node_version: 6 - Node_v4: - node_version: 4 - Node_v0_12: - node_version: 0.12 - Node_v0_10: - node_version: 0.10 - steps: - - template: .azure-pipelines-steps.yml - - - job: Test_Windows - displayName: Run Tests on Windows - pool: - vmImage: vs2017-win2016 - strategy: - matrix: - Node_v12: - node_version: 12 - Node_v10: - node_version: 10 - Node_v8: - node_version: 8 - Node_v6: - node_version: 6 - Node_v4: - node_version: 4 - npm_version: 2 - Node_v0_12: - node_version: 0.12 - npm_version: 2 - Node_v0_10: - node_version: 0.10 - npm_version: 2 - steps: - - template: .azure-pipelines-steps.yml - - - job: Test_MacOS - displayName: Run Tests on MacOS - pool: - vmImage: macos-10.13 - strategy: - matrix: - Node_v12: - node_version: 12 - Node_v10: - node_version: 10 - Node_v8: - node_version: 8 - Node_v6: - node_version: 6 - Node_v4: - node_version: 4 - Node_v0_12: - node_version: 0.12 - Node_v0_10: - node_version: 0.10 - steps: - - template: .azure-pipelines-steps.yml - - - job: Notify_Coveralls - displayName: Notify Coveralls that the parallel report is done - pool: - vmImage: "Ubuntu 16.04" - dependsOn: - - Test_Linux - - Test_Windows - - Test_MacOS - steps: - - script: curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$BUILD_NAME&payload[status]=done" - env: - COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET) - BUILD_NAME: $(Build.BuildNumber) diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..404abb2 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..3b07263 --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,75 @@ +name: dev +on: + pull_request: + push: + branches: + - master + - main +env: + CI: true + +jobs: + prettier: + name: Format code + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prettier + uses: gulpjs/prettier_action@v3.0 + with: + commit_message: 'chore: Run prettier' + prettier_options: '--write .' + + test: + name: Tests for Node ${{ matrix.node }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + node: [10, 12, 14, 16] + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + + - run: node --version + - run: npm --version + + - name: Install npm dependencies + run: npm install + + - name: Run lint + run: npm run lint + + - name: Run tests + run: npm test + + - name: Coveralls + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: ${{matrix.os}}-node-${{ matrix.node }} + parallel: true + + coveralls: + needs: test + name: Finish up + + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8a10ce3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,17 @@ +name: release +on: + push: + branches: + - master + - main + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + package-name: release-please-action + bump-minor-pre-major: true diff --git a/.gitignore b/.gitignore index 58a757a..aa0c563 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ coverage # nyc test coverage .nyc_output -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..c96ebe0 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +coverage/ +.nyc_output/ +CHANGELOG.md diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eda5b00..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -sudo: false -language: node_js -node_js: - - '12' - - '10' - - '8' - - '6' - - '4' - - '0.12' - - '0.10' -after_script: - - npm run coveralls diff --git a/LICENSE b/LICENSE index 9aedc0d..2bad23f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Blaine Bublitz, Eric Schoffstall and other contributors +Copyright (c) 2015, 2021 Blaine Bublitz, Eric Schoffstall and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 93545c2..501a03f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # async-done -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url] Allows libraries to handle various caller provided asynchronous functions uniformly. Maps promises, observables, child processes and streams, and callbacks to callback style. @@ -67,7 +67,7 @@ Optionally takes a callback to call when async tasks are complete. * `Promise` returned - Completion: [onFulfilled][promise-onfulfilled] method called - Error: [onRejected][promise-onrejected] method called -* `Observable` (e.g. from [RxJS v5][rxjs5-observable] or [RxJS v4][rxjs5-observable]) returned +* `Observable` (e.g. from [RxJS v5][rxjs5-observable] or [RxJS v4][rxjs4-observable]) returned - Completion: [complete][rxjs5-observer-complete] method called - Error: [error][rxjs5-observer-error] method called @@ -91,31 +91,24 @@ Errors can be caused by: MIT -[downloads-image]: https://img.shields.io/npm/dm/async-done.svg + +[downloads-image]: https://img.shields.io/npm/dm/async-done.svg?style=flat-square [npm-url]: https://www.npmjs.com/package/async-done -[npm-image]: https://img.shields.io/npm/v/async-done.svg +[npm-image]: https://img.shields.io/npm/v/async-done.svg?style=flat-square -[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=6&branchName=master -[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/async-done?branchName=master - -[travis-url]: https://travis-ci.org/gulpjs/async-done -[travis-image]: https://img.shields.io/travis/gulpjs/async-done.svg?label=travis-ci - -[appveyor-url]: https://ci.appveyor.com/project/gulpjs/async-done -[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/async-done.svg?label=appveyor +[ci-url]: https://github.com/gulpjs/async-done/actions?query=workflow:dev +[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/async-done/dev?style=flat-square [coveralls-url]: https://coveralls.io/r/gulpjs/async-done -[coveralls-image]: https://img.shields.io/coveralls/gulpjs/async-done/master.svg - -[gitter-url]: https://gitter.im/gulpjs/gulp -[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/async-done/master.svg?style=flat-square [end-of-stream]: https://www.npmjs.com/package/end-of-stream [domains]: http://nodejs.org/api/domain.html [event-stream]: https://github.com/dominictarr/event-stream [promise-onfulfilled]: http://promisesaplus.com/#point-26 [promise-onrejected]: http://promisesaplus.com/#point-30 -[rx4-observable]: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/observable.md +[rxjs4-observable]: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/observable.md [rxjs5-observable]: http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html [rxjs5-observer-complete]: http://reactivex.io/rxjs/class/es6/MiscJSDoc.js~ObserverDoc.html#instance-method-complete [rxjs5-observer-error]: http://reactivex.io/rxjs/class/es6/MiscJSDoc.js~ObserverDoc.html#instance-method-error + diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 47b3ca2..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -# http://www.appveyor.com/docs/appveyor-yml -# http://www.appveyor.com/docs/lang/nodejs-iojs - -environment: - matrix: - # node.js - - nodejs_version: "0.10" - - nodejs_version: "0.12" - - nodejs_version: "4" - - nodejs_version: "6" - - nodejs_version: "8" - - nodejs_version: "10" - - nodejs_version: "12" - -platform: - - x86 - - x64 - -install: - # https://www.appveyor.com/docs/lang/nodejs-iojs/#installing-any-version-of-nodejs-or-iojs - - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:PLATFORM - - npm install - -test_script: - - node --version - - npm --version - - cmd: npm test - -build: off - -# build version format -version: "{build}" diff --git a/index.d.ts b/index.d.ts index 2c4ab93..dfa8d23 100644 --- a/index.d.ts +++ b/index.d.ts @@ -58,7 +58,7 @@ declare namespace asyncDone { * Represents a callback function used to signal the completion of a * task without any result value. */ - type VoidCallback = (err: Error | null) => void; + type VoidCallback = (err: Error | null | void) => void; /** * Represents a callback function used to signal the completion of a diff --git a/package.json b/package.json index 774c733..45632f4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "repository": "gulpjs/async-done", "license": "MIT", "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" }, "main": "index.js", "types": "index.d.ts", @@ -25,29 +25,37 @@ "lint": "eslint .", "pretest": "npm run lint", "test": "nyc mocha --async-only", - "test-types": "tsc -p test/types", - "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", - "coveralls": "nyc report --reporter=text-lcov | coveralls" + "test-types": "tsc -p test/types" }, "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" + "end-of-stream": "^1.4.4", + "once": "^1.4.0", + "process-nextick-args": "^2.0.1", + "stream-exhaust": "^1.0.2" }, "devDependencies": { - "@types/node": "^9.3.0", + "@types/node": "^16.11.7", "coveralls": "github:phated/node-coveralls#2.x", - "eslint": "^2.13.1", - "eslint-config-gulp": "^3.0.1", - "expect": "^1.20.2", - "mocha": "^3.0.0", - "nyc": "^10.3.2", - "pumpify": "^1.3.6", - "rxjs": "^5.5.6", - "through2": "^2.0.0", - "typescript": "^2.6.2", - "when": "^3.7.3" + "eslint": "^7.32.0", + "eslint-config-gulp": "^5.0.1", + "eslint-plugin-node": "^11.1.0", + "expect": "^27.3.1", + "mocha": "^8.4.0", + "nyc": "^15.1.0", + "pumpify": "^2.0.1", + "rxjs": "^7.4.0", + "through2": "^4.0.2", + "typescript": "^4.4.4", + "when": "^3.7.8" + }, + "nyc": { + "reporter": [ + "lcov", + "text-summary" + ] + }, + "prettier": { + "singleQuote": true }, "keywords": [ "promises", diff --git a/test/.eslintrc b/test/.eslintrc deleted file mode 100644 index 06b940f..0000000 --- a/test/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "gulp/test" -} diff --git a/test/callbacks.js b/test/callbacks.js index 150684f..e6dfa08 100644 --- a/test/callbacks.js +++ b/test/callbacks.js @@ -27,7 +27,7 @@ describe('callbacks', function() { it('should handle an errored callback', function(done) { asyncDone(failure, function(err) { - expect(err).toBeAn(Error); + expect(err).toBeInstanceOf(Error); done(); }); }); @@ -45,7 +45,7 @@ describe('callbacks', function() { it('should not handle error if something throws inside the callback', function(done) { var d = require('domain').create(); d.on('error', function(err) { - expect(err).toBeAn(Error); + expect(err).toBeInstanceOf(Error); done(); }); diff --git a/test/child_processes.js b/test/child_processes.js index ebf6ba4..86c4653 100644 --- a/test/child_processes.js +++ b/test/child_processes.js @@ -25,28 +25,28 @@ function spawnFail() { describe('child processes', function() { it('should handle successful exec', function(done) { asyncDone(execSuccess, function(err) { - expect(err).toNotBeAn(Error); + expect(err).not.toBeInstanceOf(Error); done(); }); }); it('should handle failing exec', function(done) { asyncDone(execFail, function(err) { - expect(err).toBeAn(Error); + expect(err).toBeInstanceOf(Error); done(); }); }); it('should handle successful spawn', function(done) { asyncDone(spawnSuccess, function(err) { - expect(err).toNotBeAn(Error); + expect(err).not.toBeInstanceOf(Error); done(); }); }); it('should handle failing spawn', function(done) { asyncDone(spawnFail, function(err) { - expect(err).toBeAn(Error); + expect(err).toBeInstanceOf(Error); done(); }); }); diff --git a/test/observables.js b/test/observables.js index 4956878..413b806 100644 --- a/test/observables.js +++ b/test/observables.js @@ -4,26 +4,26 @@ var expect = require('expect'); var asyncDone = require('../'); -var Observable = require('rxjs').Observable; +var rxjs = require('rxjs'); function success() { - return Observable.empty(); + return rxjs.empty(); } function successValue() { // This corresponds to `Observable.return(42);` in RxJS 4 - return Observable.of(42); + return rxjs.of(42); } function failure() { - return Observable.throw(new Error('Observable error')); + return rxjs.throw(new Error('Observable error')); } describe('observables', function() { it('should handle a finished observable', function(done) { asyncDone(success, function(err, result) { - expect(result).toEqual(undefined); + expect(result).toBeUndefined(); done(err); }); }); @@ -37,7 +37,7 @@ describe('observables', function() { it('should handle an errored observable', function(done) { asyncDone(failure, function(err) { - expect(err).toBeAn(Error); + expect(err).toBeInstanceOf(Error); done(); }); }); diff --git a/test/promises.js b/test/promises.js index edaa8e4..eb00beb 100644 --- a/test/promises.js +++ b/test/promises.js @@ -31,15 +31,15 @@ describe('promises', function() { it('should handle a rejected promise', function(done) { asyncDone(failure, function(err) { - expect(err).toBeAn(Error); + expect(err).toBeInstanceOf(Error); done(); }); }); it('properly errors when rejected without an error', function(done) { asyncDone(rejectNoError, function(err) { - expect(err).toExist(); - expect(err).toBeAn(Error); + expect(err).toBeTruthy(); + expect(err).toBeInstanceOf(Error); done(); }); }); @@ -47,7 +47,7 @@ describe('promises', function() { it('does not swallow thrown errors in callback', function(done) { var d = domain.create(); d.once('error', function(err) { - expect(err).toExist(); + expect(err).toBeTruthy(); expect(err.message).toContain('Boom'); done(); }); diff --git a/test/streams.js b/test/streams.js index a0eed97..f0a70c3 100644 --- a/test/streams.js +++ b/test/streams.js @@ -42,6 +42,10 @@ function pumpifyError() { through() ); + pipeline.on('error', function(err) { + throw err; + }); + return read.pipe(pipeline); } @@ -52,22 +56,22 @@ function unpiped() { describe('streams', function() { it('should handle a successful stream', function(done) { asyncDone(success, function(err) { - expect(err).toNotBeAn(Error); + expect(err).not.toBeInstanceOf(Error); done(); }); }); it('should handle an errored stream', function(done) { asyncDone(failure, function(err) { - expect(err).toBeAn(Error); + expect(err).toBeInstanceOf(Error); done(); }); }); it('should handle an errored pipeline', function(done) { asyncDone(pumpifyError, function(err) { - expect(err).toBeAn(Error); - expect(err.message).toNotBe('premature close'); + expect(err).toBeInstanceOf(Error); + expect(err.message).not.toEqual('premature close'); done(); }); }); @@ -78,7 +82,7 @@ describe('streams', function() { cb(null, 3); }); }, function(err, result) { - expect(err).toNotBeAn(Error); + expect(err).not.toBeInstanceOf(Error); expect(result).toEqual(3); // To know we called the callback done(); }); @@ -86,7 +90,7 @@ describe('streams', function() { it('consumes an unpiped readable stream', function(done) { asyncDone(unpiped, function(err) { - expect(err).toNotBeAn(Error); + expect(err).not.toBeInstanceOf(Error); done(); }); }); diff --git a/test/types/observables.ts b/test/types/observables.ts index 4f0dd53..f807584 100644 --- a/test/types/observables.ts +++ b/test/types/observables.ts @@ -1,18 +1,18 @@ import asyncDone from "async-done"; -import { Observable } from "rxjs/Observable"; +import { empty, of, throwError, Observable } from "rxjs"; import 'rxjs/add/observable/empty'; import 'rxjs/add/observable/of'; function success(): Observable { - return Observable.empty(); + return empty(); } function successValue(): Observable { - return Observable.of(42); + return of(42); } function failure(): Observable { - return Observable.throw(new Error("Observable error")); + return throwError(new Error("Observable error")); } // `success` callback From a173f402f6817fcece2d81dc0d4d2724a5ac07b5 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Mon, 22 Nov 2021 15:41:28 -0700 Subject: [PATCH 2/5] Apply suggestions from code review --- LICENSE | 2 +- README.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2bad23f..976e4a8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015, 2021 Blaine Bublitz, Eric Schoffstall and other contributors +Copyright (c) 2015-2019, 2021 Blaine Bublitz and Eric Schoffstall Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 501a03f..12c1f5f 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,9 @@ MIT [coveralls-url]: https://coveralls.io/r/gulpjs/async-done [coveralls-image]: https://img.shields.io/coveralls/gulpjs/async-done/master.svg?style=flat-square + + [end-of-stream]: https://www.npmjs.com/package/end-of-stream [domains]: http://nodejs.org/api/domain.html [event-stream]: https://github.com/dominictarr/event-stream From 5f6cabd828ef32eae36a92fe0d5ec9764566591f Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Mon, 22 Nov 2021 15:49:28 -0700 Subject: [PATCH 3/5] chore: Remove process-nextick-args --- index.js | 3 +-- package.json | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/index.js b/index.js index e5be989..5d0cd80 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,6 @@ var domain = require('domain'); var eos = require('end-of-stream'); -var p = require('process-nextick-args'); var once = require('once'); var exhaust = require('stream-exhaust'); @@ -82,7 +81,7 @@ function asyncDone(fn, cb) { } } - p.nextTick(asyncRunner); + process.nextTick(asyncRunner); } module.exports = asyncDone; diff --git a/package.json b/package.json index 45632f4..edcab48 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "dependencies": { "end-of-stream": "^1.4.4", "once": "^1.4.0", - "process-nextick-args": "^2.0.1", "stream-exhaust": "^1.0.2" }, "devDependencies": { From b57cc90446003e92e71f33825d4ebd5c47bad6b6 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Mon, 22 Nov 2021 15:49:53 -0700 Subject: [PATCH 4/5] chore: Remove when --- package.json | 3 +-- test/promises.js | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index edcab48..a7db46a 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,7 @@ "pumpify": "^2.0.1", "rxjs": "^7.4.0", "through2": "^4.0.2", - "typescript": "^4.4.4", - "when": "^3.7.8" + "typescript": "^4.4.4" }, "nyc": { "reporter": [ diff --git a/test/promises.js b/test/promises.js index eb00beb..6ebda83 100644 --- a/test/promises.js +++ b/test/promises.js @@ -4,20 +4,18 @@ var domain = require('domain'); var expect = require('expect'); -var when = require('when'); - var asyncDone = require('../'); function success() { - return when.resolve(2); + return Promise.resolve(2); } function failure() { - return when.reject(new Error('Promise Error')); + return Promise.reject(new Error('Promise Error')); } function rejectNoError() { - return when.reject(); + return Promise.reject(); } describe('promises', function() { From 5b657ca27b09db60b95495eb1f7ca3409a57a6b8 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Mon, 22 Nov 2021 15:50:04 -0700 Subject: [PATCH 5/5] chore: Remove coveralls dep --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index a7db46a..e62c0f1 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ }, "devDependencies": { "@types/node": "^16.11.7", - "coveralls": "github:phated/node-coveralls#2.x", "eslint": "^7.32.0", "eslint-config-gulp": "^5.0.1", "eslint-plugin-node": "^11.1.0",