runok
Version:
NPM scripts on steroids! Replace your scripts with pure JS
26 lines (25 loc) • 562 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TaskConfig = void 0;
;
class TaskConfig {
constructor() {
this.opts = {};
}
apply(fnOrObj) {
if (!fnOrObj)
return;
if (typeof fnOrObj === "object") {
this.applyOptions(fnOrObj);
return;
}
this.applyFunction(fnOrObj);
}
applyFunction(fn) {
fn(this);
}
applyOptions(opts) {
this.opts = Object.assign(this.opts, opts);
}
}
exports.TaskConfig = TaskConfig;