Skip to content

Commit

Permalink
fix: allow merge() to not clone
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Sep 10, 2018
1 parent 4625a64 commit e628d65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Expand Up @@ -391,8 +391,9 @@ Kareem.prototype.clone = function() {
return n;
};

Kareem.prototype.merge = function(other) {
var ret = this.clone();
Kareem.prototype.merge = function(other, clone) {
clone = arguments.length === 1 ? true : clone;
var ret = clone ? this.clone() : ret;

for (let key of other._pres.keys()) {
const sourcePres = get(ret._pres, key, []);
Expand Down

0 comments on commit e628d65

Please sign in to comment.