You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
502 B
25 lines
502 B
/** |
|
* Get cache object by `name`. |
|
* |
|
* @param {String|Function} name |
|
* @param {Object} options |
|
* @return {Object} |
|
* @api private |
|
*/ |
|
|
|
var getCache = module.exports = function(name, options){ |
|
if ('function' == typeof name) return new name(options); |
|
|
|
var cache; |
|
switch (name){ |
|
// case 'fs': |
|
// cache = require('./fs') |
|
// break; |
|
case 'memory': |
|
cache = require('./memory'); |
|
break; |
|
default: |
|
cache = require('./null'); |
|
} |
|
return new cache(options); |
|
};
|
|
|