cache-storage
Version:
[ABANDONED] Advanced cache storage for node js
47 lines (34 loc) • 1.25 kB
JavaScript
// Generated by CoffeeScript 1.6.3
(function() {
var MemoryStorage, 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');
MemoryStorage = (function(_super) {
__extends(MemoryStorage, _super);
function MemoryStorage() {
_ref = MemoryStorage.__super__.constructor.apply(this, arguments);
return _ref;
}
MemoryStorage.prototype.data = null;
MemoryStorage.prototype.meta = null;
MemoryStorage.prototype.getData = function() {
if (this.data === null) {
this.data = {};
}
return this.data;
};
MemoryStorage.prototype.getMeta = function() {
if (this.meta === null) {
this.meta = {};
}
return this.meta;
};
MemoryStorage.prototype.writeData = function(data, meta) {
this.data = data;
this.meta = meta;
};
return MemoryStorage;
})(Storage);
module.exports = MemoryStorage;
}).call(this);