UNPKG

gypsum

Version:

Simple and easy lightweight typescript server side framework on Node.js.

30 lines 841 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const string_1 = require("tools-box/string"); const defaultOptions = { __name: '', isJob: true, event: null, triggered: false, interval: null, timerId: null, paused: false }; function JOB(options) { return function (target, key, descriptor) { let jobName = string_1.capitalizeFirst(key); function userJob() { this[key](); } Object.assign(userJob, defaultOptions); if (options) Object.assign(userJob, options); userJob.__name = key; Object.defineProperty(target.constructor.prototype, jobName, { value: userJob, enumerable: true }); }; } exports.JOB = JOB; //# sourceMappingURL=job.js.map