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
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const determineBaseTheme = require('./shared/colorino.DLomX7A5.cjs');
3
+ const determineBaseTheme = require('./shared/colorino.Di3ygmIx.cjs');
4
4
 
5
5
  class BrowserColorSupportDetector {
6
6
  constructor(_window, _navigator, _overrideTheme) {
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.Dpj0vB0O.mjs';
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
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const determineBaseTheme = require('./shared/colorino.DLomX7A5.cjs');
3
+ const determineBaseTheme = require('./shared/colorino.Di3ygmIx.cjs');
4
4
 
5
5
  class OscThemeQuerier {
6
6
  constructor(_stdin, _stdout, _timeout = 300, _cacheTtl = 36e5) {
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.Dpj0vB0O.mjs';
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 (!this.isBrowser && (this._colorLevel === ColorLevel.NO_COLOR || this._colorLevel === "UnknownEnv") && !this._options.disableWarnings) {
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 isObject = arg !== null && typeof arg === "object" && typeof arg !== "string" && !(arg instanceof Error);
140
- if (isObject) {
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 (!this.isBrowser && (this._colorLevel === ColorLevel.NO_COLOR || this._colorLevel === "UnknownEnv") && !this._options.disableWarnings) {
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 isObject = arg !== null && typeof arg === "object" && typeof arg !== "string" && !(arg instanceof Error);
142
- if (isObject) {
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(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "colorino",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "A super simple colorized logger that gets the most out of your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",