From c089430016fb78764f5dec291e862e6edbfbef15 Mon Sep 17 00:00:00 2001 From: mrmlnc Date: Fri, 14 Jul 2023 16:37:02 +0300 Subject: [PATCH 1/2] build: fix build benchmark files --- package.json | 2 +- src/benchmark/suites/product/stream.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3baf47eb..31f7396f 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@types/merge2": "^1.1.4", "@types/micromatch": "^4.0.0", "@types/mocha": "^5.2.7", - "@types/node": "^12.7.8", + "@types/node": "^14.18.53", "@types/picomatch": "^2.3.0", "@types/sinon": "^7.5.0", "bencho": "^0.1.1", diff --git a/src/benchmark/suites/product/stream.ts b/src/benchmark/suites/product/stream.ts index f1259bf5..15705af5 100644 --- a/src/benchmark/suites/product/stream.ts +++ b/src/benchmark/suites/product/stream.ts @@ -21,9 +21,9 @@ class Glob { }); const action = new Promise((resolve, reject) => { - stream.once('error', (error) => reject(error)); + stream.on('error', (error) => reject(error)); stream.on('data', (entry: string) => entries.push(entry)); - stream.once('end', () => resolve(entries)); + stream.on('end', () => resolve(entries)); }); await this._measure(() => action); From 2a0c808d688955d68a46fa000994592530f6fa2a Mon Sep 17 00:00:00 2001 From: mrmlnc Date: Fri, 14 Jul 2023 16:43:15 +0300 Subject: [PATCH 2/2] fix: cast the ignore field to the array --- src/settings.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/settings.ts b/src/settings.ts index 3000541a..8cc9d681 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -185,6 +185,9 @@ export default class Settings { if (this.stats) { this.objectMode = true; } + + // Remove the cast to the array in the next major (#404). + this.ignore = ([] as Pattern[]).concat(this.ignore); } private _getValue(option: T | undefined, value: T): T {