Skip to content

Commit 03a2b7f

Browse files
committed
make .union key behavior consistent with other methods
1 parent be3670e commit 03a2b7f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,12 @@ function namespace(prop) {
104104
*/
105105

106106
Cache.prototype.union = function(key, val) {
107+
if (Array.isArray(key) && arguments.length === 2) {
108+
key = utils.toPath(key);
109+
}
107110
var ctx = prop ? this[prop] : this;
108111
utils.union(ctx, key, utils.arrayify(val));
112+
this.emit('union', val);
109113
return this;
110114
};
111115

0 commit comments

Comments
 (0)