Fix utils.groupBy where watch key would cause error in Firefox

This commit is contained in:
Tanner Linsley
2017-01-19 19:37:32 -07:00
parent bea4b366d6
commit 66f1b04ba6
+1 -1
View File
@@ -135,7 +135,7 @@ function prefixAll (obj) {
function groupBy (xs, key) {
return xs.reduce((rv, x, i) => {
const resKey = typeof key === 'function' ? key(x, i) : x[key]
rv[resKey] = rv[resKey] || []
rv[resKey] = isArray(rv[resKey]) ? rv[resKey] : []
rv[resKey].push(x)
return rv
}, {})