Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
fix groupBy filter so it doesn't permanently mutate the list items
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsaj committed Sep 29, 2014
1 parent 8b9a044 commit e9a5ad6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/filters.js
Expand Up @@ -250,14 +250,14 @@ exports.groupBy = function (input, key) {
}

var keyname = value[key],
newVal = utils.extend({}, value);
delete value[key];
newValue = utils.extend({}, value);
delete newValue[key];

if (!out[keyname]) {
out[keyname] = [];
}

out[keyname].push(value);
out[keyname].push(newValue);
});

return out;
Expand Down

0 comments on commit e9a5ad6

Please sign in to comment.