diff --git a/index.js b/index.js index 856f4d7..6d7250d 100644 --- a/index.js +++ b/index.js @@ -61,8 +61,8 @@ module.exports = function (alternatives) { - At options -> credentials -> 1: Encountered an unexpected property 'foo'" */ - let [ sameLevelErrors, nestedErrors ] = splitFilter(allErrors, (error) => { - return (error.path.length === 0); + let nestedErrors = allErrors.filter((error) => { + return (error.path.length !== 0); }); let sameOrigin = areErrorsFromSameOrigin(nestedErrors); diff --git a/package.json b/package.json index 1dcd97d..0085aa1 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "@validatem/combinator": "^0.1.1", "@validatem/error": "^1.0.0", "@validatem/validation-result": "^0.1.2", - "flatten": "^1.0.3", - "split-filter": "^1.1.3" + "flatten": "^1.0.3" } } diff --git a/yarn.lock b/yarn.lock index 8707d1d..6c8ef83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -208,11 +208,6 @@ is-string@^1.0.5: resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== -split-filter@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/split-filter/-/split-filter-1.1.3.tgz#c68cc598783d88f60d16e7b452dacfe95ba60539" - integrity sha512-2xXwhWeJUFrYE8CL+qoy9mCohu5/E+uglvpqL1FVXz1XbvTwivafVC6oTDeg/9ksOAxg6DvyCF44Dvf5crFU0w== - supports-color@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1"