UNPKG

consolev

Version:

Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.

32 lines (24 loc) 957 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var nodeEnv = "development"; var prefixArgs = [[" " + nodeEnv + " ", "background-color: " + ( '#f00') + "; color: #fff;"]]; function consolev() { var _console; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var consolevArgs = args.map(function (arg) { return Array.isArray(arg) ? arg : [arg]; }).filter(function (arg) { return arg[0] !== void 0; }); var optionalArgs = [].concat(prefixArgs, consolevArgs); var message = '%c%s%c '.repeat(optionalArgs.length); var optionalParams = optionalArgs.map(function (arg) { var _arg$; return [(_arg$ = arg[1]) != null ? _arg$ : '', arg[0], '']; }).flat(); (_console = console).log.apply(_console, [message].concat(optionalParams)); } exports.default = consolev; //# sourceMappingURL=consolev.cjs.development.js.map