Skip to content

Commit

Permalink
fix(doc): fix documentation of extendWithArrayIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSwitch committed Feb 1, 2023
1 parent 4908a12 commit c294da6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions object/extendWithArrayIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const instanceOf = require('./instanceOf.js');
* @param {...object} args - a series of objects to extend
* @returns {object} extended object
*/
function extend(base, ...args) {
function extendWithArrayIndex(base, ...args) {
args.forEach(o => {
if (instanceOf(base, Object) && instanceOf(o, Object) && base !== o) {
for (const x in o) {
Expand All @@ -17,7 +17,7 @@ function extend(base, ...args) {
continue;
}

base[x] = extend(base[x], o[x]);
base[x] = extendWithArrayIndex(base[x], o[x]);
}
}
else if (Array.isArray(o)) {
Expand All @@ -31,4 +31,4 @@ function extend(base, ...args) {
return base;
}

module.exports = extend;
module.exports = extendWithArrayIndex;

0 comments on commit c294da6

Please # to comment.