From 79765fbff3a50d4ca0bf97bc51d74fda95915601 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 6 Dec 2021 17:50:44 +0100 Subject: [PATCH] Upgrade dev dependencies Closes #198 --- bench.js | 5 +++-- gitignore.js | 11 +++++++++-- index.test-d.ts | 1 + package.json | 15 +++++++-------- test.js | 7 +++++-- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/bench.js b/bench.js index 29b10d5..b8fb1c7 100644 --- a/bench.js +++ b/bench.js @@ -1,4 +1,5 @@ /* global after, before, bench, suite */ +import process from 'node:process'; import fs from 'node:fs'; import path from 'node:path'; import {fileURLToPath} from 'node:url'; @@ -56,7 +57,7 @@ const runners = [ run: patterns => { fastGlob.sync(patterns); }, - } + }, ]; const benchs = [ @@ -80,7 +81,7 @@ const benchs = [ 'a/*', 'b/*', ], - } + }, ]; before(() => { diff --git a/gitignore.js b/gitignore.js index 8c524a8..9db60cc 100644 --- a/gitignore.js +++ b/gitignore.js @@ -1,3 +1,4 @@ +import process from 'node:process'; import {promisify} from 'node:util'; import fs from 'node:fs'; import path from 'node:path'; @@ -90,7 +91,10 @@ export const isGitIgnored = async options => { options = normalizeOptions(options); const paths = await fastGlob('**/.gitignore', { - ignore: DEFAULT_IGNORE.concat(options.ignore), + ignore: [ + ...DEFAULT_IGNORE, + ...options.ignore, + ], cwd: options.cwd, }); @@ -104,7 +108,10 @@ export const isGitIgnoredSync = options => { options = normalizeOptions(options); const paths = fastGlob.sync('**/.gitignore', { - ignore: DEFAULT_IGNORE.concat(options.ignore), + ignore: [ + ...DEFAULT_IGNORE, + ...options.ignore, + ], cwd: options.cwd, }); diff --git a/index.test-d.ts b/index.test-d.ts index aa93e80..21c1632 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -1,3 +1,4 @@ +import {Buffer} from 'node:buffer'; import {expectType} from 'tsd'; import { GlobTask, diff --git a/package.json b/package.json index 7685c57..60ce7f6 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,7 @@ }, "scripts": { "bench": "npm update glob-stream fast-glob && matcha bench.js", - "//test": "xo && ava && tsd", - "test": "echo foo" + "test": "xo && ava && tsd" }, "files": [ "index.js", @@ -63,21 +62,21 @@ "array-union": "^3.0.1", "dir-glob": "^3.0.1", "fast-glob": "^3.2.7", - "ignore": "^5.1.8", + "ignore": "^5.1.9", "merge2": "^1.4.1", "slash": "^4.0.0" }, "devDependencies": { - "@types/node": "^16.6.1", + "@types/node": "^16.11.11", "ava": "^3.15.0", "get-stream": "^6.0.1", - "glob-stream": "^6.1.0", + "glob-stream": "^7.0.0", "globby": "sindresorhus/globby#main", "matcha": "^0.7.0", "rimraf": "^3.0.2", - "tsd": "^0.17.0", - "typescript": "^4.3.5", - "xo": "^0.44.0" + "tsd": "^0.19.0", + "typescript": "^4.5.2", + "xo": "^0.47.0" }, "xo": { "ignores": [ diff --git a/test.js b/test.js index 33398ff..599badd 100644 --- a/test.js +++ b/test.js @@ -1,3 +1,4 @@ +import process from 'node:process'; import fs from 'node:fs'; import path from 'node:path'; import util from 'node:util'; @@ -45,7 +46,8 @@ test.after(() => { }); test('glob - async', async t => { - t.deepEqual((await globby('*.tmp')).sort(), ['a.tmp', 'b.tmp', 'c.tmp', 'd.tmp', 'e.tmp']); + const result = await globby('*.tmp'); + t.deepEqual(result.sort(), ['a.tmp', 'b.tmp', 'c.tmp', 'd.tmp', 'e.tmp']); }); test('glob - async - multiple file paths', t => { @@ -83,7 +85,8 @@ test('return [] for all negative patterns - async', async t => { }); test('glob - stream', async t => { - t.deepEqual((await getStream.array(globbyStream('*.tmp'))).sort(), ['a.tmp', 'b.tmp', 'c.tmp', 'd.tmp', 'e.tmp']); + const result = await getStream.array(globbyStream('*.tmp')); + t.deepEqual(result.sort(), ['a.tmp', 'b.tmp', 'c.tmp', 'd.tmp', 'e.tmp']); }); test('glob - stream async iterator support', async t => {