UNPKG

class-o-mat

Version:

ALPHA VERSION ONLY: class-o-mats will help to create getter-setter functionality with validations that can be attached to a container class for easier coding. Some basic validations are included. class-o-mats also has the ability to store params as bloc

47 lines (35 loc) 1.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _bunyan = require("bunyan"); var _bunyan2 = _interopRequireDefault(_bunyan); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var log = _bunyan2.default.createLogger({ name: "AutonumGenerator" }); var AutonumGenerator = function () { function AutonumGenerator() { _classCallCheck(this, AutonumGenerator); this._count = 0; } _createClass(AutonumGenerator, [{ key: "count", value: function count() { return this._count; } }, { key: "last", value: function last() { return this._count - 1; } }, { key: "next", value: function next() { return this._count++; } }]); return AutonumGenerator; }(); exports.default = AutonumGenerator; //# sourceMappingURL=autonum-generator.js.map