Skip to content

Commit

Permalink
do not depend on top-level indirection files, access exported classes…
Browse files Browse the repository at this point in the history
… as qcache.<name>
  • Loading branch information
andrasq committed Feb 11, 2019
1 parent 62115b0 commit c52101e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* Licensed under the Apache License, Version 2.0
*/

var qcache = require('./qcache');
var qcache = require('./lib/qcache');

// TODO: deprecate top-level default class
module.exports = function(opt) { return new qcache.TtlCache(opt) };

// TODO: deprecate TimeoutCache alias
module.exports.TimeoutCache = qcache.TimeoutCache;

module.exports.TtlCache = require('./ttlcache');
module.exports.TtlCache = require('./lib/qcache').TtlCache;
module.exports.LruCache1 = require('./lib/lrucache');
module.exports.LruCache2 = require('./lrucache');
module.exports.LruCache2 = require('./lib/lrucache2');
module.exports.LruCache = module.exports.LruCache2;
module.exports.MultiValueCache = require('./mvcache');
module.exports.MultiValueCache = require('./lib/mvcache');
module.exports.MvcCache = module.exports.MultiValueCache;
4 changes: 2 additions & 2 deletions test/test-qcache.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ module.exports = {

'TtlCache': {
'index should export TtlCache': function(t) {
var qcache = require('../index');
var qcache = require('../');
t.ok(new qcache() instanceof TtlCache);
t.done();
},

'ttlcache should export TtlCache': function(t) {
var qcache = require('../ttlcache');
var qcache = require('../').TtlCache;
t.ok(new qcache() instanceof TtlCache);
t.done();
},
Expand Down

0 comments on commit c52101e

Please sign in to comment.