diff options
Diffstat (limited to 'src/util/sugar.js')
-rw-r--r-- | src/util/sugar.js | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/util/sugar.js b/src/util/sugar.js index 0a5de482..2883d949 100644 --- a/src/util/sugar.js +++ b/src/util/sugar.js @@ -90,7 +90,7 @@ export function delay(ms) { // There's a proposal for a native JS function like this, 8ut it's not even // past stage 1 yet: https://github.com/tc39/proposal-regex-escaping export function escapeRegex(string) { - return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); } export function bindOpts(fn, bind) { @@ -319,13 +319,6 @@ function _filterAggregate(mode, promiseAll, array, fn, aggregateOpts) { return value === aggregateOpts.returnOnFail ? value : value.input; } - function wrapperFunction(x, ...rest) { - return { - input: x, - output: fn(x, ...rest), - }; - } - if (mode === 'sync') { const result = array .map( @@ -426,9 +419,7 @@ export function showAggregate( error.errors .map((error) => recursive(error, {level: level + 1})) .flatMap((str) => str.split('\n')) - .map((line, i, lines) => - i === 0 ? ` ${head} ${line}` : ` ${bar} ${line}` - ) + .map((line, i) => i === 0 ? ` ${head} ${line}` : ` ${bar} ${line}`) .join('\n') ); } else { |