From 5e689b74fe95d3953bcc0a54ea64910bff41e598 Mon Sep 17 00:00:00 2001 From: f0x Date: Mon, 22 Aug 2022 20:41:13 +0200 Subject: [PATCH] change flatten to Array#flat (Node 10.x EOL) --- index.js | 3 +-- package.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 9cdbea0..52c6897 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,6 @@ const asExpression = require("as-expression"); const defaultValue = require("default-value"); const assureArray = require("assure-array"); -const flatten = require("flatten"); const arrayUnion = require("array-union"); const ValidationError = require("@validatem/error"); @@ -17,7 +16,7 @@ function containsRules(rules) { return false; } else { // TODO: Switch to `Array#flat` once Node 10.x goes EOL (April 2021) - let flattenedRules = flatten(assureArray(rules)); + let flattenedRules = assureArray(rules).flat(); if (!flattenedRules.some((rule) => rule != null)) { return false; diff --git a/package.json b/package.json index 37da40d..c4768f2 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,7 @@ "array-union": "^2.1.0", "as-expression": "^1.0.0", "assure-array": "^1.0.0", - "default-value": "^1.0.0", - "flatten": "^1.0.3" + "default-value": "^1.0.0" }, "devDependencies": { "@validatem/core": "^0.3.1", -- 2.40.1