diff --git a/example.js b/example.js index 9f002e3..e5c1705 100644 --- a/example.js +++ b/example.js @@ -19,7 +19,12 @@ let arrayB = [ { prop: 4 } ]; -console.log(mergeArray([ arrayA, arrayB ])); // [ { prop: 4 }, { prop: 6 } ] +let arrayC = [ + { prop: 5 }, + { prop: 6 } +]; + +console.log(mergeArray([ arrayA, arrayB, arrayC ])); // [ { prop: 9 }, { prop: 12 } ] // TODO: Document merge functions, also for arrays diff --git a/index.js b/index.js index d6011f9..900a40a 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,6 @@ const { validateArguments, validateValue } = require("@validatem/core"); const isArray = require("@validatem/is-array"); const isPlainObject = require("@validatem/is-plain-object"); const defaultTo = require("@validatem/default-to"); -const hasLengthOf = require("@validatem/has-length-of"); const removeNullishItems = require("@validatem/remove-nullish-items"); const virtualProperty = require("@validatem/virtual-property"); const wrapPath = require("@validatem/wrap-path"); @@ -105,8 +104,7 @@ module.exports = { let [ items ] = validateArguments(arguments, [ [ "items", [ isArray, - removeNullishItems, - hasLengthOf(2) + removeNullishItems ]] ]); diff --git a/package.json b/package.json index cc06d77..8402207 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "dependencies": { "@validatem/core": "^0.3.3", "@validatem/default-to": "^0.1.0", - "@validatem/has-length-of": "^0.1.0", "@validatem/is-array": "^0.1.1", "@validatem/is-plain-object": "^0.1.1", "@validatem/remove-nullish-items": "^0.1.0",