change flatten to Array#flat (Node 10.x EOL)

main
f0x 2 years ago
parent a84b6eff86
commit cfaab3cfae

@ -28,7 +28,6 @@
"create-error": "^0.3.1", "create-error": "^0.3.1",
"default-value": "^1.0.0", "default-value": "^1.0.0",
"execall": "^2.0.0", "execall": "^2.0.0",
"flatten": "^1.0.3",
"indent-string": "^4.0.0", "indent-string": "^4.0.0",
"is-arguments": "^1.0.4", "is-arguments": "^1.0.4",
"supports-color": "^7.1.0", "supports-color": "^7.1.0",

@ -1,7 +1,6 @@
"use strict"; "use strict";
const isArguments = require("is-arguments"); const isArguments = require("is-arguments");
const flatten = require("flatten");
const asExpression = require("as-expression"); const asExpression = require("as-expression");
const syncpipe = require("syncpipe"); const syncpipe = require("syncpipe");
@ -68,7 +67,7 @@ function applyDefinitions(args, definitions, remainingArgumentsIndex) {
return { return {
errors: syncpipe(results, [ errors: syncpipe(results, [
(_) => _.map((result) => result.errors), (_) => _.map((result) => result.errors),
(_) => flatten(_) // TODO: Switch to `Array#flat` once Node 10.x goes EOL (April 2021) (_) => _.flat()
]), ]),
newValue: results.map((result) => result.newValue) newValue: results.map((result) => result.newValue)
}; };

Loading…
Cancel
Save