From b586da63b49359e3357fdc21d641c62cde5108ff Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 5 Sep 2023 21:43:35 +0000 Subject: [PATCH 01/16] BREAKING: Increase minimum Node.js version to 16; recommended to 18 --- .github/workflows/build-test.yml | 2 +- .nvmrc | 2 +- README.md | 2 +- package.json | 4 ++-- yarn.lock | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0c86368..0a1f0ef 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [16.x, 18.x, 20.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} diff --git a/.nvmrc b/.nvmrc index dae199a..3f430af 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v12 +v18 diff --git a/README.md b/README.md index d654bdb..5b2d246 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ streamB.pipe(evilAiBrain).pipe(streamB); ### Setup -- Install [Node.js](https://nodejs.org) version 12 +- Install [Node.js](https://nodejs.org) version 18 - If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you. - Install [Yarn v1](https://yarnpkg.com/en/docs/install) - Run `yarn setup` to install dependencies and run any requried post-install scripts diff --git a/package.json b/package.json index 14c7f9c..8283d4c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "url": "https://github.com/MetaMask/object-multiplex.git" }, "engines": { - "node": ">=12.0.0" + "node": "^16.20 || ^18.16 || >=20" }, "files": [ "dist/" @@ -39,7 +39,7 @@ "@metamask/eslint-config-nodejs": "^6.0.0", "@metamask/eslint-config-typescript": "^6.0.0", "@types/end-of-stream": "^1.4.0", - "@types/node": "^14.14.9", + "@types/node": "^16", "@types/once": "^1.4.0", "@types/readable-stream": "^2.3.9", "@typescript-eslint/eslint-plugin": "^4.26.0", diff --git a/yarn.lock b/yarn.lock index b5829f9..5616dc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -147,10 +147,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.10.tgz#5958a82e41863cfc71f2307b3748e3491ba03785" integrity sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ== -"@types/node@^14.14.9": - version "14.14.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.9.tgz#04afc9a25c6ff93da14deabd65dc44485b53c8d6" - integrity sha512-JsoLXFppG62tWTklIoO4knA+oDTYsmqWxHRvd4lpmfQRNhX6osheUOWETP2jMoV/2bEHuMra8Pp3Dmo/stBFcw== +"@types/node@^16": + version "16.18.48" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.48.tgz#3bc872236cdb31cb51024d8875d655e25db489a4" + integrity sha512-mlaecDKQ7rIZrYD7iiKNdzFb6e/qD5I9U1rAhq+Fd+DWvYVs+G2kv74UFHmSOlg5+i/vF3XxuR522V4u8BqO+Q== "@types/once@^1.4.0": version "1.4.0" From ccc006336c5bd784ad8a2b7f54f34f5a7fbd2912 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Wed, 27 Sep 2023 22:12:43 +0000 Subject: [PATCH 02/16] deps: readable-stream@^2.3.3->^3.6.2 --- package.json | 4 ++-- yarn.lock | 36 ++++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 8283d4c..c175fc9 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "dependencies": { "end-of-stream": "^1.4.4", "once": "^1.4.0", - "readable-stream": "^2.3.3" + "readable-stream": "^3.6.2" }, "devDependencies": { "@lavamoat/allow-scripts": "^1.0.6", @@ -41,7 +41,7 @@ "@types/end-of-stream": "^1.4.0", "@types/node": "^16", "@types/once": "^1.4.0", - "@types/readable-stream": "^2.3.9", + "@types/readable-stream": "^2.3.15", "@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/parser": "^4.26.0", "eslint": "^7.27.0", diff --git a/yarn.lock b/yarn.lock index 5616dc1..7a817ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -157,13 +157,13 @@ resolved "https://registry.yarnpkg.com/@types/once/-/once-1.4.0.tgz#7bfe3d99a0951f3141bac2617c9827525788b8f5" integrity sha512-cnEvTAVVRqF6OQg/4SLnbxQ0slZJHqZQDve5BzGhcIQtuMpPv8T5QNS2cBPa/W0jTxciqwn7bmJAIGe/bOJ5Kw== -"@types/readable-stream@^2.3.9": - version "2.3.9" - resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.9.tgz#40a8349e6ace3afd2dd1b6d8e9b02945de4566a9" - integrity sha512-sqsgQqFT7HmQz/V5jH1O0fvQQnXAJO46Gg9LRO/JPfjmVmGUlcx831TZZO3Y3HtWhIkzf3kTsNT0Z0kzIhIvZw== +"@types/readable-stream@^2.3.15": + version "2.3.15" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" + integrity sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ== dependencies: "@types/node" "*" - safe-buffer "*" + safe-buffer "~5.1.1" "@typescript-eslint/eslint-plugin@^4.26.0": version "4.26.0" @@ -1290,7 +1290,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@~2.0.3, inherits@~2.0.4: +inherits@2, inherits@^2.0.3, inherits@~2.0.3, inherits@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -1965,7 +1965,7 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" -readable-stream@^2.0.6, readable-stream@^2.3.3: +readable-stream@^2.0.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -1978,6 +1978,15 @@ readable-stream@^2.0.6, readable-stream@^2.3.3: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@^3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + regexp.prototype.flags@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" @@ -2079,7 +2088,7 @@ run-parallel@^1.1.9: resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.10.tgz#60a51b2ae836636c81377df16cb107351bcd13ef" integrity sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw== -safe-buffer@*, safe-buffer@^5.0.1, safe-buffer@^5.1.2: +safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -2260,6 +2269,13 @@ string.prototype.trimstart@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -2455,10 +2471,10 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== uuid@^3.3.2: version "3.4.0" From fcbbf1e7f00f75499cf736695db51ec20b28fc52 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Wed, 27 Sep 2023 22:24:20 +0000 Subject: [PATCH 03/16] devDeps: @types/readable-stream@^2.3.15->4.0.0 We use readable-stream@3 which had no types package published. Newer versions of @types/readable-stream@4.x cause type issues --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c175fc9..23851f4 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@types/end-of-stream": "^1.4.0", "@types/node": "^16", "@types/once": "^1.4.0", - "@types/readable-stream": "^2.3.15", + "@types/readable-stream": "4.0.0", "@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/parser": "^4.26.0", "eslint": "^7.27.0", From 27d13c495a67a1798e1190f2f388d59c1716aa15 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Thu, 28 Sep 2023 00:01:45 +0000 Subject: [PATCH 04/16] deps: replace end-of-stream with readable-stream.finished --- package.json | 1 - src/ObjectMultiplex.ts | 7 +++---- src/readable-stream.d.ts | 20 ++++++++++++++++++++ test/index.js | 5 ++--- yarn.lock | 30 +++++++++++++++--------------- 5 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 src/readable-stream.d.ts diff --git a/package.json b/package.json index 23851f4..f0d8cd5 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "author": "", "license": "ISC", "dependencies": { - "end-of-stream": "^1.4.4", "once": "^1.4.0", "readable-stream": "^3.6.2" }, diff --git a/src/ObjectMultiplex.ts b/src/ObjectMultiplex.ts index 679018c..bacd619 100644 --- a/src/ObjectMultiplex.ts +++ b/src/ObjectMultiplex.ts @@ -1,5 +1,4 @@ -import { Duplex } from 'readable-stream'; -import eos from 'end-of-stream'; +import { Duplex, finished } from 'readable-stream'; import once from 'once'; import { Substream } from './Substream'; @@ -112,6 +111,6 @@ function anyStreamEnd( _cb: (error?: Error | null) => void, ) { const cb = once(_cb); - eos(stream, { readable: false }, cb); - eos(stream, { writable: false }, cb); + finished(stream, { readable: false }, cb); + finished(stream, { writable: false }, cb); } diff --git a/src/readable-stream.d.ts b/src/readable-stream.d.ts new file mode 100644 index 0000000..e0465c9 --- /dev/null +++ b/src/readable-stream.d.ts @@ -0,0 +1,20 @@ +// import indicrectly used for module augmentation to extend @types/readable-stream with missing exports +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import * as readableStream from 'readable-stream'; + +interface Options { + readable?: boolean | undefined; + writable?: boolean | undefined; + error?: boolean | undefined; +} +type Stream = NodeJS.ReadableStream | NodeJS.WritableStream; +type Callback = (error?: Error | null) => void; + +declare module 'readable-stream' { + function finished( + stream: Stream, + options: Options, + callback?: Callback, + ): () => void; + function finished(stream: Stream, callback?: Callback): () => void; +} diff --git a/test/index.js b/test/index.js index ec687d4..5ce0eb1 100644 --- a/test/index.js +++ b/test/index.js @@ -1,7 +1,6 @@ const test = require('tape'); const pump = require('pump'); -const { PassThrough, Transform } = require('readable-stream'); -const endOfStream = require('end-of-stream'); +const { PassThrough, Transform, finished } = require('readable-stream'); // eslint-disable-next-line import/no-unresolved const ObjMultiplex = require('../dist'); @@ -120,6 +119,6 @@ function basicTestSetup() { function bufferToEnd(stream, callback) { const results = []; - endOfStream(stream, (err) => callback(err, results)); + finished(stream, (err) => callback(err, results)); stream.on('data', (chunk) => results.push(chunk)); } diff --git a/yarn.lock b/yarn.lock index 7a817ea..ffd0226 100644 --- a/yarn.lock +++ b/yarn.lock @@ -126,9 +126,9 @@ read-package-json-fast "^2.0.1" "@types/end-of-stream@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@types/end-of-stream/-/end-of-stream-1.4.0.tgz#4e73ac87d15b6cc89cdaf2d26a59f617c778cb07" - integrity sha512-d0FD2A4vpFI8wyQeQbr9VDVKtA1PmeGO3Ntn+6j626QTtAQ9HSqWFACP7rTHaV2cspVhLijl00Vvkf/U2UZGWA== + version "1.4.2" + resolved "https://registry.yarnpkg.com/@types/end-of-stream/-/end-of-stream-1.4.2.tgz#5af2084392363429bad321501174c18490eb7bd6" + integrity sha512-vb9AZX90RRPvrsNKVR5Vgo41XNsy9/KwRgW3cK6HPr8faFNMEVslbo0373mTVjdFCM5gCR9JGFn5mQDqcewZ8A== dependencies: "@types/node" "*" @@ -143,9 +143,9 @@ integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= "@types/node@*": - version "14.14.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.10.tgz#5958a82e41863cfc71f2307b3748e3491ba03785" - integrity sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ== + version "20.7.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.7.1.tgz#06d732ead0bd5ad978ef0ea9cbdeb24dc8717514" + integrity sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg== "@types/node@^16": version "16.18.48" @@ -157,10 +157,10 @@ resolved "https://registry.yarnpkg.com/@types/once/-/once-1.4.0.tgz#7bfe3d99a0951f3141bac2617c9827525788b8f5" integrity sha512-cnEvTAVVRqF6OQg/4SLnbxQ0slZJHqZQDve5BzGhcIQtuMpPv8T5QNS2cBPa/W0jTxciqwn7bmJAIGe/bOJ5Kw== -"@types/readable-stream@^2.3.15": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" - integrity sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ== +"@types/readable-stream@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.0.tgz#9bcb888b9c77478b02490365d3e0c34fd8b6d5ae" + integrity sha512-s6YqDV111kwuFsT9SwFC+FmZ5n1SEp4H9DXGg6Zqag0lPGeEvBGP9UaLJYpX4cxY7fAFnx2avy1QVvft0LLb7g== dependencies: "@types/node" "*" safe-buffer "~5.1.1" @@ -643,7 +643,7 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -end-of-stream@^1.1.0, end-of-stream@^1.4.4: +end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== @@ -2449,10 +2449,10 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -typescript@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" - integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== +typescript@^4.8.4: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== unbox-primitive@^1.0.1: version "1.0.1" From 0aada396df1b4ac4d4da3a22a525aa731236083a Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Thu, 28 Sep 2023 00:03:04 +0000 Subject: [PATCH 05/16] devDeps: replace pump with readable-stream.pipeline --- package.json | 1 - test/index.js | 7 +++---- yarn.lock | 17 +---------------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index f0d8cd5..b84bd94 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.4.0", "prettier": "^2.3.0", - "pump": "^1.0.2", "rimraf": "^3.0.2", "tape": "^4.8.0", "typescript": "^4.1.2" diff --git a/test/index.js b/test/index.js index 5ce0eb1..bd9c1f6 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,5 @@ const test = require('tape'); -const pump = require('pump'); -const { PassThrough, Transform, finished } = require('readable-stream'); +const { PassThrough, Transform, finished, pipeline } = require('readable-stream'); // eslint-disable-next-line import/no-unresolved const ObjMultiplex = require('../dist'); @@ -55,7 +54,7 @@ test('roundtrip', (t) => { }, }); - pump(outStream, doubler, outStream); + pipeline(outStream, doubler, outStream); bufferToEnd(inStream, (err, results) => { t.error(err, 'should not error'); @@ -105,7 +104,7 @@ function basicTestSetup() { const inStream = inMux.createStream('hello'); const outStream = outMux.createStream('hello'); - pump(inMux, inTransport, outMux, outTransport, inMux); + pipeline(inMux, inTransport, outMux, outTransport, inMux); return { inTransport, diff --git a/yarn.lock b/yarn.lock index ffd0226..e71d972 100644 --- a/yarn.lock +++ b/yarn.lock @@ -643,13 +643,6 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - enquirer@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" @@ -1776,7 +1769,7 @@ object.values@^1.1.3: define-properties "^1.1.3" es-abstract "^1.18.2" -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -1922,14 +1915,6 @@ psl@^1.1.28: resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== -pump@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" - integrity sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" From 3e425cd196064f189399000a8fc5c958479d76a0 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Thu, 28 Sep 2023 01:46:35 +0000 Subject: [PATCH 06/16] types/remove stream-resolved.finished overload --- src/readable-stream.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/readable-stream.d.ts b/src/readable-stream.d.ts index e0465c9..a76842f 100644 --- a/src/readable-stream.d.ts +++ b/src/readable-stream.d.ts @@ -16,5 +16,4 @@ declare module 'readable-stream' { options: Options, callback?: Callback, ): () => void; - function finished(stream: Stream, callback?: Callback): () => void; } From 673e535437faf0a849f0ce9ab934ae7220440cc9 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Thu, 28 Sep 2023 01:51:10 +0000 Subject: [PATCH 07/16] yarn dedupe --- yarn.lock | 184 ++++++------------------------------------------------ 1 file changed, 18 insertions(+), 166 deletions(-) diff --git a/yarn.lock b/yarn.lock index e71d972..4f4ea52 100644 --- a/yarn.lock +++ b/yarn.lock @@ -413,15 +413,7 @@ braces@^3.0.1: dependencies: fill-range "^7.0.1" -call-bind@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.0.tgz#24127054bb3f9bdcb4b1fb82418186072f77b8ce" - integrity sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.0" - -call-bind@^1.0.2: +call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== @@ -662,42 +654,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0-next.1: - version "1.17.7" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" - integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.2" - is-regex "^1.1.1" - object-inspect "^1.8.0" - object-keys "^1.1.1" - object.assign "^4.1.1" - string.prototype.trimend "^1.0.1" - string.prototype.trimstart "^1.0.1" - -es-abstract@^1.18.0-next.1: - version "1.18.0-next.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" - integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.2" - is-negative-zero "^2.0.0" - is-regex "^1.1.1" - object-inspect "^1.8.0" - object-keys "^1.1.1" - object.assign "^4.1.1" - string.prototype.trimend "^1.0.1" - string.prototype.trimstart "^1.0.1" - -es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: +es-abstract@^1.17.0-next.1, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: version "1.18.3" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.3.tgz#25c4c3380a27aa203c44b2b685bba94da31b63e0" integrity sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw== @@ -889,16 +846,7 @@ eslint@^7.27.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^7.3.0: - version "7.3.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.0.tgz#dc30437cf67947cf576121ebd780f15eeac72348" - integrity sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw== - dependencies: - acorn "^7.4.0" - acorn-jsx "^5.2.0" - eslint-visitor-keys "^1.3.0" - -espree@^7.3.1: +espree@^7.3.0, espree@^7.3.1: version "7.3.1" resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== @@ -1091,16 +1039,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.1.tgz#94a9768fcbdd0595a1c9273aacf4c89d075631be" - integrity sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: +get-intrinsic@^1.0.0, get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== @@ -1123,19 +1062,7 @@ glob-parent@^5.0.0, glob-parent@^5.1.0: dependencies: is-glob "^4.0.1" -glob@^7.1.3, glob@~7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.4: +glob@^7.1.3, glob@^7.1.4, glob@~7.1.6: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== @@ -1173,12 +1100,7 @@ globby@^11.0.3: merge2 "^1.3.0" slash "^3.0.0" -graceful-fs@^4.1.2: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - -graceful-fs@^4.2.3: +graceful-fs@^4.1.2, graceful-fs@^4.2.3: version "4.2.6" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== @@ -1211,12 +1133,7 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== - -has-symbols@^1.0.2: +has-symbols@^1.0.1, has-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== @@ -1310,24 +1227,12 @@ is-boolean-object@^1.1.0: dependencies: call-bind "^1.0.2" -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" - integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== - -is-callable@^1.2.3: +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.2, is-callable@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== -is-core-module@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.1.0.tgz#a4cc031d9b1aca63eecbd18a650e13cb4eeab946" - integrity sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA== - dependencies: - has "^1.0.3" - -is-core-module@^2.2.0, is-core-module@^2.4.0: +is-core-module@^2.1.0, is-core-module@^2.2.0, is-core-module@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== @@ -1368,12 +1273,7 @@ is-glob@^4.0.0, is-glob@^4.0.1: dependencies: is-extglob "^2.1.1" -is-negative-zero@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.0.tgz#9553b121b0fac28869da9ed459e20c7543788461" - integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= - -is-negative-zero@^2.0.1: +is-negative-zero@^2.0.0, is-negative-zero@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== @@ -1388,14 +1288,7 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-regex@^1.0.4, is-regex@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" - integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== - dependencies: - has-symbols "^1.0.1" - -is-regex@^1.1.3: +is-regex@^1.0.4, is-regex@^1.1.1, is-regex@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== @@ -1410,24 +1303,12 @@ is-regex@~1.0.5: dependencies: has "^1.0.3" -is-string@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" - integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== - -is-string@^1.0.6: +is-string@^1.0.5, is-string@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== -is-symbol@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" - integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== - dependencies: - has-symbols "^1.0.1" - -is-symbol@^1.0.3: +is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== @@ -1722,16 +1603,11 @@ object-assign@^4.1.0: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-inspect@^1.10.3: +object-inspect@^1.10.3, object-inspect@^1.8.0: version "1.10.3" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369" integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw== -object-inspect@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" - integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== - object-inspect@~1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" @@ -2026,15 +1902,7 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve@^1.10.0, resolve@^1.10.1, resolve@^1.13.1: - version "1.19.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" - integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== - dependencies: - is-core-module "^2.1.0" - path-parse "^1.0.6" - -resolve@^1.20.0: +resolve@^1.10.0, resolve@^1.10.1, resolve@^1.13.1, resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -2222,15 +2090,7 @@ string.prototype.trim@~1.2.1: define-properties "^1.1.3" es-abstract "^1.18.0-next.1" -string.prototype.trimend@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz#a22bd53cca5c7cf44d7c9d5c732118873d6cd18b" - integrity sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - -string.prototype.trimend@^1.0.4: +string.prototype.trimend@^1.0.1, string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== @@ -2238,15 +2098,7 @@ string.prototype.trimend@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimstart@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz#9b4cb590e123bb36564401d59824298de50fd5aa" - integrity sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - -string.prototype.trimstart@^1.0.4: +string.prototype.trimstart@^1.0.1, string.prototype.trimstart@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== @@ -2434,7 +2286,7 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -typescript@^4.8.4: +typescript@^4.1.2: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== From 40e2e3728c93e388b6010a71ba031b924f91f099 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Thu, 28 Sep 2023 03:18:23 +0000 Subject: [PATCH 08/16] fix test after readable-stream upgrade --- test/index.js | 32 ++++++++++++++++++++++++-------- yarn.lock | 20 ++++++++++---------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/test/index.js b/test/index.js index bd9c1f6..640da21 100644 --- a/test/index.js +++ b/test/index.js @@ -1,5 +1,10 @@ +const { + PassThrough, + Transform, + finished, + pipeline, +} = require('readable-stream'); const test = require('tape'); -const { PassThrough, Transform, finished, pipeline } = require('readable-stream'); // eslint-disable-next-line import/no-unresolved const ObjMultiplex = require('../dist'); @@ -18,7 +23,7 @@ test('basic - string', (t) => { inStream.write('wuurl'); // simulate disconnect - setTimeout(() => inTransport.destroy()); + setImmediate(() => inTransport.end(null, () => undefined)); }); test('basic - obj', (t) => { @@ -39,7 +44,7 @@ test('basic - obj', (t) => { inStream.write({ message: 'wuurl' }); // simulate disconnect - setTimeout(() => inTransport.destroy()); + setImmediate(() => inTransport.end(null, () => undefined)); }); test('roundtrip', (t) => { @@ -54,7 +59,7 @@ test('roundtrip', (t) => { }, }); - pipeline(outStream, doubler, outStream); + pipeline(outStream, doubler, outStream, () => undefined); bufferToEnd(inStream, (err, results) => { t.error(err, 'should not error'); @@ -66,7 +71,7 @@ test('roundtrip', (t) => { inStream.write(12); // simulate disconnect - setTimeout(() => outTransport.destroy(), 100); + setTimeout(() => outTransport.end(), 100); }); test('error on createStream if destroyed', (t) => { @@ -104,7 +109,7 @@ function basicTestSetup() { const inStream = inMux.createStream('hello'); const outStream = outMux.createStream('hello'); - pipeline(inMux, inTransport, outMux, outTransport, inMux); + pipeline(inMux, inTransport, outMux, outTransport, inMux, () => undefined); return { inTransport, @@ -118,6 +123,17 @@ function basicTestSetup() { function bufferToEnd(stream, callback) { const results = []; - finished(stream, (err) => callback(err, results)); - stream.on('data', (chunk) => results.push(chunk)); + let flushed = false; + function onFinish(err) { + if (flushed) { + return; + } + flushed = true; + callback(err, results); + } + stream.prependListener('close', onFinish); + finished(stream, onFinish); + stream.on('data', (chunk) => { + results.push(chunk); + }); } diff --git a/yarn.lock b/yarn.lock index 4f4ea52..6493ad9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -245,7 +245,7 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -acorn-jsx@^5.2.0, acorn-jsx@^5.3.1: +acorn-jsx@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== @@ -1039,7 +1039,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.0, get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== @@ -1227,12 +1227,12 @@ is-boolean-object@^1.1.0: dependencies: call-bind "^1.0.2" -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.2, is-callable@^1.2.3: +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== -is-core-module@^2.1.0, is-core-module@^2.2.0, is-core-module@^2.4.0: +is-core-module@^2.2.0, is-core-module@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== @@ -1273,7 +1273,7 @@ is-glob@^4.0.0, is-glob@^4.0.1: dependencies: is-extglob "^2.1.1" -is-negative-zero@^2.0.0, is-negative-zero@^2.0.1: +is-negative-zero@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== @@ -1288,7 +1288,7 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-regex@^1.0.4, is-regex@^1.1.1, is-regex@^1.1.3: +is-regex@^1.0.4, is-regex@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== @@ -1603,7 +1603,7 @@ object-assign@^4.1.0: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-inspect@^1.10.3, object-inspect@^1.8.0: +object-inspect@^1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369" integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw== @@ -1626,7 +1626,7 @@ object-keys@^1.0.12, object-keys@^1.1.1: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object.assign@^4.1.1, object.assign@^4.1.2: +object.assign@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== @@ -2090,7 +2090,7 @@ string.prototype.trim@~1.2.1: define-properties "^1.1.3" es-abstract "^1.18.0-next.1" -string.prototype.trimend@^1.0.1, string.prototype.trimend@^1.0.4: +string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== @@ -2098,7 +2098,7 @@ string.prototype.trimend@^1.0.1, string.prototype.trimend@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimstart@^1.0.1, string.prototype.trimstart@^1.0.4: +string.prototype.trimstart@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== From 56e4193d5fa42dba5bf6ca4c07efecd17228f811 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 3 Oct 2023 13:46:32 +0000 Subject: [PATCH 09/16] devDeps: remove unused @types/end-of-stream --- package.json | 1 - yarn.lock | 7 ------- 2 files changed, 8 deletions(-) diff --git a/package.json b/package.json index b84bd94..d237a64 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@metamask/eslint-config": "^6.0.0", "@metamask/eslint-config-nodejs": "^6.0.0", "@metamask/eslint-config-typescript": "^6.0.0", - "@types/end-of-stream": "^1.4.0", "@types/node": "^16", "@types/once": "^1.4.0", "@types/readable-stream": "4.0.0", diff --git a/yarn.lock b/yarn.lock index 6493ad9..038cad3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -125,13 +125,6 @@ node-gyp "^7.1.0" read-package-json-fast "^2.0.1" -"@types/end-of-stream@^1.4.0": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@types/end-of-stream/-/end-of-stream-1.4.2.tgz#5af2084392363429bad321501174c18490eb7bd6" - integrity sha512-vb9AZX90RRPvrsNKVR5Vgo41XNsy9/KwRgW3cK6HPr8faFNMEVslbo0373mTVjdFCM5gCR9JGFn5mQDqcewZ8A== - dependencies: - "@types/node" "*" - "@types/json-schema@^7.0.7": version "7.0.7" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" From b426a78f9830333ba31121d677a0069abb4c3fea Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 24 Oct 2023 06:29:26 +0000 Subject: [PATCH 10/16] test: remove redundant `finished` call --- test/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/index.js b/test/index.js index 640da21..7fc7108 100644 --- a/test/index.js +++ b/test/index.js @@ -1,7 +1,6 @@ const { PassThrough, Transform, - finished, pipeline, } = require('readable-stream'); const test = require('tape'); @@ -132,7 +131,6 @@ function bufferToEnd(stream, callback) { callback(err, results); } stream.prependListener('close', onFinish); - finished(stream, onFinish); stream.on('data', (chunk) => { results.push(chunk); }); From 3e38d74ce117eb5d5221f3de7c1cdc568974492e Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 24 Oct 2023 15:45:17 +0900 Subject: [PATCH 11/16] Revert "test: remove redundant `finished` call" This reverts commit b426a78f9830333ba31121d677a0069abb4c3fea. --- test/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/index.js b/test/index.js index 7fc7108..640da21 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,7 @@ const { PassThrough, Transform, + finished, pipeline, } = require('readable-stream'); const test = require('tape'); @@ -131,6 +132,7 @@ function bufferToEnd(stream, callback) { callback(err, results); } stream.prependListener('close', onFinish); + finished(stream, onFinish); stream.on('data', (chunk) => { results.push(chunk); }); From 82137095a85762fdd1fdb732e3a4dfe89ea342c1 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 24 Oct 2023 06:46:26 +0000 Subject: [PATCH 12/16] test: remove close listener --- test/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/index.js b/test/index.js index 640da21..bc2c007 100644 --- a/test/index.js +++ b/test/index.js @@ -131,7 +131,6 @@ function bufferToEnd(stream, callback) { flushed = true; callback(err, results); } - stream.prependListener('close', onFinish); finished(stream, onFinish); stream.on('data', (chunk) => { results.push(chunk); From 6b51f34c56e2c2e6b24e1c337cc8737d4508ba3b Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 24 Oct 2023 07:04:01 +0000 Subject: [PATCH 13/16] test: manual listener attach instead of 'finished' --- test/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/index.js b/test/index.js index bc2c007..7fc7108 100644 --- a/test/index.js +++ b/test/index.js @@ -1,7 +1,6 @@ const { PassThrough, Transform, - finished, pipeline, } = require('readable-stream'); const test = require('tape'); @@ -131,7 +130,7 @@ function bufferToEnd(stream, callback) { flushed = true; callback(err, results); } - finished(stream, onFinish); + stream.prependListener('close', onFinish); stream.on('data', (chunk) => { results.push(chunk); }); From 67e542f221210fad3882d182914e2e3f737e22ed Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 24 Oct 2023 07:15:17 +0000 Subject: [PATCH 14/16] add comment --- test/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/index.js b/test/index.js index 7fc7108..62ac0e3 100644 --- a/test/index.js +++ b/test/index.js @@ -130,6 +130,8 @@ function bufferToEnd(stream, callback) { flushed = true; callback(err, results); } + // cleanup of stream should be called at end of each stream + // this ensures that stream.prependListener('close', onFinish); stream.on('data', (chunk) => { results.push(chunk); From 861639ccf35bdf3402a88a1d9f3b7aaec8164cd4 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 24 Oct 2023 07:16:51 +0000 Subject: [PATCH 15/16] spelling error --- src/readable-stream.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/readable-stream.d.ts b/src/readable-stream.d.ts index a76842f..11b6ee6 100644 --- a/src/readable-stream.d.ts +++ b/src/readable-stream.d.ts @@ -1,4 +1,4 @@ -// import indicrectly used for module augmentation to extend @types/readable-stream with missing exports +// import indirectly used for module augmentation to extend @types/readable-stream with missing exports // eslint-disable-next-line @typescript-eslint/no-unused-vars import * as readableStream from 'readable-stream'; From 1a4583fe0b1c8edba00c3df751cc830a61b05a6b Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 24 Oct 2023 07:17:24 +0000 Subject: [PATCH 16/16] lint:fix --- test/index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/index.js b/test/index.js index 62ac0e3..7c52ed9 100644 --- a/test/index.js +++ b/test/index.js @@ -1,8 +1,4 @@ -const { - PassThrough, - Transform, - pipeline, -} = require('readable-stream'); +const { PassThrough, Transform, pipeline } = require('readable-stream'); const test = require('tape'); // eslint-disable-next-line import/no-unresolved const ObjMultiplex = require('../dist');