Skip to content

Commit

Permalink
feat(merge): add merge function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hamilton committed Nov 29, 2018
1 parent 3a623cf commit a98e5ce
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/merge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// npm
import circleAssign from 'circle-assign';


/**
* Merge all sources into the target with the most right source
* having the most priority
*
* Uses circle-assign
* @see https://www.npmjs.com/package/circle-assign
*
* @param {object} target The target object
* @param {...object} sources The sources
*
* @returns {object} The merged object
*/
function merge(target, ...sources) {
return circleAssign.apply(null, [target, ...sources]);
}

export default merge;

0 comments on commit a98e5ce

Please # to comment.