MCPcopy Index your code
hub / github.com/debug-js/debug / formatArgs

Function formatArgs

src/node.js:167–180  ·  view source on GitHub ↗

* Adds ANSI color escape codes if enabled. * * @api public

(args)

Source from the content-addressed store, hash-verified

165 */
166
167function formatArgs(args) {
168 const {namespace: name, useColors} = this;
169
170 if (useColors) {
171 const c = this.color;
172 const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
173 const prefix = ` ${colorCode};1m${name} \u001B[0m`;
174
175 args[0] = prefix + args[0].split('\n').join('\n' + prefix);
176 args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
177 } else {
178 args[0] = getDate() + name + ' ' + args[0];
179 }
180}
181
182function getDate() {
183 if (exports.inspectOpts.hideDate) {

Callers

nothing calls this directly

Calls 1

getDateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…