Fixed Issue with Browser colors
This commit is contained in:
parent
95217429be
commit
a36ad425dc
1 changed files with 14 additions and 0 deletions
|
|
@ -21,6 +21,20 @@ const levelMapping = [
|
|||
'ansi16m',
|
||||
];
|
||||
|
||||
// True for any Browser or WebWorker
|
||||
// copied from https://github.com/flexdinesh/browser-or-node/blob/master/src/index.js available under the MIT license
|
||||
const isBrowser =
|
||||
(typeof window !== "undefined" && typeof window.document !== "undefined")
|
||||
||
|
||||
(typeof self === "object" &&
|
||||
self.constructor &&
|
||||
self.constructor.name === "DedicatedWorkerGlobalScope");
|
||||
|
||||
if(isBrowser)
|
||||
{
|
||||
stderrColor = stdoutColor = 3;
|
||||
}
|
||||
|
||||
const styles = Object.create(null);
|
||||
|
||||
const applyOptions = (object, options = {}) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue