Skip to content
Myr

Started removing usage of Collection

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 2932bf5 · Browse files · 5 files+31 added−19 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+31 added−19 removed

  • other:+31 added−19 removed

5 files+31 added−19 removed

modified:lib/express/plugins/body-decoder.js+6 added
modified:lib/express/plugins/cache.js+7 added-5 removed
28 unmodified lines
29 * @api public30 */31 32 set: function(key, val) {33 if (typeof key !== 'string') throw new Error(this.name + ' store #set() key must be a string')33 if (typeof key !== 'string')34 throw new Error(this.name + ' store #set() key must be a string')35 },36 37 /**38 * Ensure that the given _key_ is a string.
3 unmodified lines
42 * @api public43 */44 45 get: function(key) {45 if (typeof key !== 'string') throw new Error(this.name + 'store #get() key must be a string')46 if (typeof key !== 'string')47 throw new Error(this.name + 'store #get() key must be a string')48 },49 50 /**51 * Convert to '[NAME Store]'.
63 unmodified lines
115 return this.data[key] instanceof Cache ?116 this.data[key].val :117 null118 var regexp = this.normalize(key) 117 return $(this.data).reduce({}, function(vals, cache){119 return this.data.reduce(function(vals, cache){120 if (regexp.test(cache.key))121 vals[cache.key] = cache.val122 return vals121 })123 }, {})124 },125 126 /**127 * Clear data matching the given _key_.
26 unmodified lines
154 155 reap: function(ms) {156 var self = this,157 threshold = Number(new Date(Number(new Date) - ms))156 $(this.data).each(function(cache){158 this.data.each(function(cache){159 if (cache.created < threshold)160 self.clear(cache.key)161 })162 },
58 unmodified lines
modified:lib/express/plugins/cookie.js+4 added-4 removed
modified:lib/express/core.js+6 added-8 removed
122 unmodified lines
123 * @api private124 */125 126 matchingRoute: function(){127 var self = this128 return $(Express.routes).find(function(route){129 return self.match(route)130 })127 return Express.routes.find(function(route){128 return this.match(route)129 }, this)130 },131 132 /**133 * Check if _route_ matches the current request.
20 unmodified lines
154 * @api private155 */156 157 mapParams: function(route) {159 var self = this160 $(route.params).each(function(key, i){161 self.request.params.path[key] = self.request.captures[++i]162 })158 route.params.each(function(key, i){159 this.request.params.path[key] = this.request.captures[++i]160 }, this)161 }162})163164// --- Server
172 unmodified lines
modified:lib/express/plugin.js+8 added-2 removed