Skip to content
Myr

Converted more to use class.js

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

authored by visionmedia · committed by visionmedia · parent 63cc7eb · Browse files · 2 files+8 added−8 removed
This commit

State

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

Diff stats

2 files+8 added−8 removed

  • other:+8 added−8 removed

2 files+8 added−8 removed

modified:lib/express/plugins/cache.js+6 added-6 removed
1 unmodified line
2// Express - Cache - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)34// --- Cache56var Cache = Class({6var Cache = new NewClass({7 8 /**9 * Initialize cache with _key_ and _val_.10 */11 12 init: function(key, val) {12 constructor: function(key, val) {13 this.key = key14 this.val = val15 this.created = Number(new Date)16 }17})1819// --- Store2021exports.Store = Class({21exports.Store = new NewClass({22 23 /**24 * Ensure that the given _key_ is a string.25 * Override in subclass to provide data-store specific functionality.
46 unmodified lines
72 /**73 * Initialize data.74 */75 76 init: function() {76 constructor: function() {77 this.data = {}78 },79 80 /**
5 unmodified lines
86 * @api public87 */88 89 set: function(key, val) {90 this.__super__(key, val)90 exports.Store.prototype.set.apply(this, arguments)91 return this.data[key] = new Cache(key, val), val92 },93 94 /**
14 unmodified lines
109 * @api public110 */111 112 get: function(key) {113 this.__super__(key)113 exports.Store.prototype.get.apply(this, arguments)114 if (key.indexOf('*') === -1)115 return this.data[key] instanceof Cache ?116 this.data[key].val :117 null
103 unmodified lines
modified:lib/express/plugins/session.js+2 added-2 removed
31 unmodified lines
32})3334// --- Store3536exports.Store = Class({36exports.Store = new NewClass({37 38 /**39 * Convert to '[NAME Store]'.40 *
19 unmodified lines
60 /**61 * Initialize in-memory session store.62 */63 64 init: function() {64 constructor: function() {65 this.store = {}66 },67 68 /**
133 unmodified lines