fixtures/app.js
raw| 1 | function App(options) { |
| 2 | this.options = options || {}; |
| 3 | } |
| 4 | App.prototype.set = function(key, value) { |
| 5 | this[key] = value; |
| 6 | return this; |
| 7 | }; |
| 8 | App.prototype.get = function(key) { |
| 9 | return this[key]; |
| 10 | }; |
| 11 | App.prototype.del = function(key) { |
| 12 | delete this[key]; |
| 13 | }; |
| 14 | Object.defineProperty(App.prototype, 'count', { |
| 15 | get: function () { |
| 16 | return Object.keys(this).length; |
| 17 | }, |
| 18 | set: function () { |
| 19 | } |
| 20 | }); |
| 21 | |
| 22 | module.exports = App; |