Remove item count requirement

master
Sven Slootweg 4 years ago
parent 0c390a14bc
commit 426b578acc

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

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

@ -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",

Loading…
Cancel
Save