From 4f7a43c0552f2e8b2324e8a5c289269d91642212 Mon Sep 17 00:00:00 2001 From: fisker Date: Tue, 4 Jul 2023 10:37:05 +0800 Subject: [PATCH 1/3] Update dependencies --- package.json | 15 +++++++-------- tests/globby.js | 12 ++++++++++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 7e6c634..cb9ac30 100644 --- a/package.json +++ b/package.json @@ -60,22 +60,21 @@ ], "dependencies": { "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", "merge2": "^1.4.1", - "slash": "^4.0.0" + "slash": "^5.1.0" }, "devDependencies": { "@globby/main-branch": "sindresorhus/globby#main", - "@types/node": "^17.0.18", + "@types/node": "^20.3.3", "ava": "^5.3.1", "benchmark": "2.1.4", - "get-stream": "^6.0.1", - "glob-stream": "^7.0.0", - "rimraf": "^3.0.2", + "glob-stream": "^8.0.0", + "rimraf": "^5.0.1", "tempy": "^3.0.0", "tsd": "^0.28.1", - "typescript": "^4.5.5", + "typescript": "^5.1.6", "xo": "^0.54.2" }, "xo": { diff --git a/tests/globby.js b/tests/globby.js index 238a6e2..ab3ed69 100644 --- a/tests/globby.js +++ b/tests/globby.js @@ -3,7 +3,6 @@ import fs from 'node:fs'; import path from 'node:path'; import util from 'node:util'; import test from 'ava'; -import getStream from 'get-stream'; import {temporaryDirectory} from 'tempy'; import { globby, @@ -42,11 +41,20 @@ const stabilizeResult = result => result }) .sort((a, b) => (a.path || a).localeCompare(b.path || b)); +const streamToArray = async stream => { + const result = []; + for await (const chunk of stream) { + result.push(chunk); + } + + return result; +}; + const runGlobby = async (t, patterns, options) => { const syncResult = globbySync(patterns, options); const promiseResult = await globby(patterns, options); // TODO: Use `Array.fromAsync` when Node.js supports it - const streamResult = await getStream.array(globbyStream(patterns, options)); + const streamResult = await streamToArray(globbyStream(patterns, options)); const result = stabilizeResult(promiseResult); t.deepEqual( From cdb25bc4e4a0fc2bcb84a693ae6b5c13cf77ae6d Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 4 Jul 2023 21:45:04 +0800 Subject: [PATCH 2/3] Update tests/globby.js Co-authored-by: Sindre Sorhus --- tests/globby.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/globby.js b/tests/globby.js index ab3ed69..18b296e 100644 --- a/tests/globby.js +++ b/tests/globby.js @@ -53,7 +53,7 @@ const streamToArray = async stream => { const runGlobby = async (t, patterns, options) => { const syncResult = globbySync(patterns, options); const promiseResult = await globby(patterns, options); - // TODO: Use `Array.fromAsync` when Node.js supports it + // TODO: Use `stream.toArray()` when targeting Node.js 16. const streamResult = await streamToArray(globbyStream(patterns, options)); const result = stabilizeResult(promiseResult); From 6688c84de3b9e7815d0861e6799a0dd171a57be7 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 4 Jul 2023 21:45:55 +0800 Subject: [PATCH 3/3] Downgrade `slash` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cb9ac30..03096a9 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "fast-glob": "^3.3.0", "ignore": "^5.2.4", "merge2": "^1.4.1", - "slash": "^5.1.0" + "slash": "^4.0.0" }, "devDependencies": { "@globby/main-branch": "sindresorhus/globby#main",