UNPKG

@sudoo/marked

Version:

JavaScript & TypeScript code runner in JavaScript, safe with marked territory, asynchronous

38 lines (37 loc) 711 B
"use strict"; /** * @author WMXPY * @namespace Util_Node * @description Context */ Object.defineProperty(exports, "__esModule", { value: true }); exports.LimitCounter = void 0; class LimitCounter { constructor(limit) { this._count = 0; this._limit = limit; } add() { this._count++; return this; } amount() { return this._count; } addAndCheck() { return this.add().check(); } check() { if (this._count > this._limit) { return true; } else { return false; } } reset() { this._count = 0; return this; } } exports.LimitCounter = LimitCounter;