Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #253

Merged
merged 3 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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