cache-storage
Version:
[ABANDONED] Advanced cache storage for node js
55 lines (41 loc) • 1.54 kB
JavaScript
// Generated by CoffeeScript 1.6.3
(function() {
var DevNullStorage, Storage, _ref,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Storage = require('./Storage');
DevNullStorage = (function(_super) {
__extends(DevNullStorage, _super);
function DevNullStorage() {
_ref = DevNullStorage.__super__.constructor.apply(this, arguments);
return _ref;
}
DevNullStorage.prototype.getData = function(fn) {
return fn(null, {});
};
DevNullStorage.prototype.getMeta = function(fn) {
return fn(null, {});
};
DevNullStorage.prototype.writeData = function(data, meta, fn) {
return fn(null);
};
DevNullStorage.prototype.read = function(key, fn) {
return fn(null, null);
};
DevNullStorage.prototype.write = function(key, data, dependencies, fn) {
if (dependencies == null) {
dependencies = {};
}
if (Object.prototype.toString.call(dependencies) === '[object Function]') {
fn = dependencies;
dependencies = {};
}
return fn(null);
};
DevNullStorage.prototype.remove = function(key, fn) {
return fn(null);
};
return DevNullStorage;
})(Storage);
module.exports = DevNullStorage;
}).call(this);