debug-color2
Version:
colorize console log, this module can work with require('debug')
56 lines • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fillProperty = exports.methods = exports.methods_stderr = exports.methods_inspector = exports.methods_other = exports.methods_output = exports.methods_stdout = void 0;
function noop(...argv) { }
exports.methods_stdout = [
"debug",
"info",
"log",
];
exports.methods_output = [
"table",
"dir",
"dirxml",
];
exports.methods_other = [
"clear",
"group",
"groupCollapsed",
"groupEnd",
"time",
"timeEnd",
"count",
];
exports.methods_inspector = [
"profile",
"profileEnd",
"timeStamp",
"markTimeline",
"timeline",
"timelineEnd",
];
exports.methods_stderr = [
"assert",
"error",
"trace",
"warn",
"exception",
];
exports.methods = [].concat(exports.methods_stdout, exports.methods_stderr, exports.methods_inspector, exports.methods_other, exports.methods_output);
function fillProperty(target, ls, fn) {
// @ts-ignore
target !== null && target !== void 0 ? target : (target = console);
// @ts-ignore
ls !== null && ls !== void 0 ? ls : (ls = exports.methods);
// @ts-ignore
fn !== null && fn !== void 0 ? fn : (fn = noop);
ls.forEach(function (method) {
if (!(method in target)) {
target[method] = fn;
}
});
return target;
}
exports.fillProperty = fillProperty;
exports.default = fillProperty;
//# sourceMappingURL=fill-property.js.map