Skip to content

Commit

Permalink
Update dependencies (#253)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
fisker and sindresorhus committed Jul 5, 2023
1 parent 51a5e34 commit 0ae43b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
13 changes: 6 additions & 7 deletions package.json
Expand Up @@ -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": {
Expand Down
14 changes: 11 additions & 3 deletions tests/globby.js
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 0ae43b9

Please sign in to comment.