Function
format
(args: Array<any>, customPrefix?: string)
Source from the content-addressed store, hash-verified
| 4 | export let prefix = "🦋 "; |
| 5 | |
| 6 | function format(args: Array<any>, customPrefix?: string) { |
| 7 | let fullPrefix = |
| 8 | prefix + (customPrefix === undefined ? "" : " " + customPrefix); |
| 9 | return ( |
| 10 | fullPrefix + |
| 11 | util |
| 12 | .format("", ...args) |
| 13 | .split("\n") |
| 14 | .join("\n" + fullPrefix + " ") |
| 15 | ); |
| 16 | } |
| 17 | |
| 18 | export function error(...args: Array<any>) { |
| 19 | console.error(format(args, pc.red("error"))); |
Tested by
no test coverage detected