Fixed const reassignment error

This commit is contained in:
Christopher-Robin Ebbinghaus 2021-10-17 18:16:06 +11:00
parent 682ee2cd5f
commit 959d44851b

View file

@ -6,7 +6,27 @@ import {
} from './util.js';
import template from './templates.js';
const {stdout: stdoutColor, stderr: stderrColor} = supportsColor;
// 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");
// Overwrite SupportsColor if we are running in Browser or WebWorker
const { stdout: stdoutColor, stderr: stderrColor } = !isBrowser
? supportsColor
: {
stdout: {
level: 3,
},
stderr: {
level: 3,
},
};
const {isArray} = Array;
const GENERATOR = Symbol('GENERATOR');
@ -21,20 +41,6 @@ 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 = {}) => {