aboutsummaryrefslogtreecommitdiff
path: root/node_modules/stylus/lib/cache/index.js
blob: 58a0f6c890cadc623143bf1f627daef6cdf737df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * 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);
};