|
|
|
@ -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;
|
|
|
|
|