Blame view

node_modules/stylus/lib/cache/index.js 502 Bytes
ce4c83ff   wxy   初始提交
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);
  };