From 0ae43b9da4c9a62649fb5f159810a5cfd1770e13 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Thu, 6 Jul 2023 06:00:41 +0800 Subject: [PATCH] Update dependencies (#253) Co-authored-by: Sindre Sorhus --- package.json | 13 ++++++------- tests/globby.js | 14 +++++++++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 7e6c634..03096a9 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" }, "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..18b296e 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)); + // TODO: Use `stream.toArray()` when targeting Node.js 16. + const streamResult = await streamToArray(globbyStream(patterns, options)); const result = stabilizeResult(promiseResult); t.deepEqual(