Skip to content

Commit

Permalink
@recursive/assign support for node 6
Browse files Browse the repository at this point in the history
  • Loading branch information
omrilotan committed Apr 2, 2020
1 parent 9ad6520 commit 5c4e618
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions packages/assign/lib/assignArray/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ const assignable = require('../assignable');
* @param {Array} source The array from which to assign respective values
* no return value
*/
module.exports = (target, source) => source.forEach(
(item, index) => assignable(target[index]) && assignable(item)
?
require('../assign')(target[index], item)
:
target[index] = item === undefined
? target[index]
: item,
);
module.exports = function assignArray(target, source) {
source.forEach(
(item, index) => assignable(target[index]) && assignable(item)
?
require('../assign')(target[index], item)
:
target[index] = item === undefined
? target[index]
: item
);
}
2 changes: 1 addition & 1 deletion packages/assign/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@recursive/assign",
"version": "2.0.0",
"version": "2.0.1",
"description": "Recursive assign for objects, arrays and more",
"keywords": [
"deep",
Expand Down

0 comments on commit 5c4e618

Please sign in to comment.