colorino 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.cjs
CHANGED
package/dist/browser.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ColorLevel, t as themePalettes, a as Colorino, I as InputValidator, d as determineBaseTheme } from './shared/colorino.
|
|
1
|
+
import { C as ColorLevel, t as themePalettes, a as Colorino, I as InputValidator, d as determineBaseTheme } from './shared/colorino.BKNhSLFs.mjs';
|
|
2
2
|
|
|
3
3
|
class BrowserColorSupportDetector {
|
|
4
4
|
constructor(_window, _navigator, _overrideTheme) {
|
package/dist/node.cjs
CHANGED
package/dist/node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as err, O as OscQueryError, o as ok, C as ColorLevel, d as determineBaseTheme, t as themePalettes, a as Colorino, I as InputValidator } from './shared/colorino.
|
|
1
|
+
import { e as err, O as OscQueryError, o as ok, C as ColorLevel, d as determineBaseTheme, t as themePalettes, a as Colorino, I as InputValidator } from './shared/colorino.BKNhSLFs.mjs';
|
|
2
2
|
|
|
3
3
|
class OscThemeQuerier {
|
|
4
4
|
constructor(_stdin, _stdout, _timeout = 300, _cacheTtl = 36e5) {
|
|
@@ -72,7 +72,7 @@ class Colorino {
|
|
|
72
72
|
this._colorLevel = this._detectColorSupport();
|
|
73
73
|
const validatePaletteResult = this._validator.validatePalette(this._palette);
|
|
74
74
|
if (validatePaletteResult.isErr()) throw validatePaletteResult.error;
|
|
75
|
-
if (
|
|
75
|
+
if (this._colorLevel !== ColorLevel.NO_COLOR && !this._options.disableWarnings && this._colorLevel === "UnknownEnv") {
|
|
76
76
|
this._maybeWarnUser();
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -136,10 +136,14 @@ class Colorino {
|
|
|
136
136
|
const processedArgs = [];
|
|
137
137
|
let previousWasObject = false;
|
|
138
138
|
for (const arg of args) {
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const isFormattableObject = arg !== null && typeof arg === "object" && typeof arg !== "string" && !(arg instanceof Error);
|
|
140
|
+
const isError = arg instanceof Error;
|
|
141
|
+
if (isFormattableObject) {
|
|
141
142
|
processedArgs.push("\n" + this._formatValue(arg));
|
|
142
143
|
previousWasObject = true;
|
|
144
|
+
} else if (isError) {
|
|
145
|
+
processedArgs.push("\n", arg);
|
|
146
|
+
previousWasObject = true;
|
|
143
147
|
} else {
|
|
144
148
|
if (typeof arg === "string" && previousWasObject) {
|
|
145
149
|
processedArgs.push(`
|
|
@@ -74,7 +74,7 @@ class Colorino {
|
|
|
74
74
|
this._colorLevel = this._detectColorSupport();
|
|
75
75
|
const validatePaletteResult = this._validator.validatePalette(this._palette);
|
|
76
76
|
if (validatePaletteResult.isErr()) throw validatePaletteResult.error;
|
|
77
|
-
if (
|
|
77
|
+
if (this._colorLevel !== ColorLevel.NO_COLOR && !this._options.disableWarnings && this._colorLevel === "UnknownEnv") {
|
|
78
78
|
this._maybeWarnUser();
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -138,10 +138,14 @@ class Colorino {
|
|
|
138
138
|
const processedArgs = [];
|
|
139
139
|
let previousWasObject = false;
|
|
140
140
|
for (const arg of args) {
|
|
141
|
-
const
|
|
142
|
-
|
|
141
|
+
const isFormattableObject = arg !== null && typeof arg === "object" && typeof arg !== "string" && !(arg instanceof Error);
|
|
142
|
+
const isError = arg instanceof Error;
|
|
143
|
+
if (isFormattableObject) {
|
|
143
144
|
processedArgs.push("\n" + this._formatValue(arg));
|
|
144
145
|
previousWasObject = true;
|
|
146
|
+
} else if (isError) {
|
|
147
|
+
processedArgs.push("\n", arg);
|
|
148
|
+
previousWasObject = true;
|
|
145
149
|
} else {
|
|
146
150
|
if (typeof arg === "string" && previousWasObject) {
|
|
147
151
|
processedArgs.push(`
|