Fixed Cache Store.Memory usage of Object#reduce()

Esse commit está contido em:
visionmedia
2010-04-29 08:42:51 -07:00
commit 1bc9a1af6a
+7 -6
Ver Arquivo
@@ -126,12 +126,13 @@ exports.Store.Memory = exports.Store.extend({
return callback(this.data[key] instanceof Cache
? this.data[key].val
: null)
var regexp = this.normalize(key)
callback(this.data.reduce(function(vals, cache){
if (regexp.test(cache.key))
vals[cache.key] = cache.val
return vals
}, {}))
var regexp = this.normalize(key),
keys = Object.keys(this.data),
matches = {}
for (var i = 0, len = keys.length; i < len; ++i)
if (regexp.test(keys[i]))
matches[keys[i]] = this.data[keys[i]]
return matches
},
/**