@orkestrel/console 0.0.13 → 0.0.14
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/src/core/index.cjs +6 -6
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.js +6 -6
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +8 -7
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.js +8 -7
- package/dist/src/server/index.js.map +1 -1
- package/package.json +11 -11
package/dist/src/core/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
let _orkestrel_emitter = require("@orkestrel/emitter");
|
|
3
2
|
let _orkestrel_contract = require("@orkestrel/contract");
|
|
3
|
+
let _orkestrel_emitter = require("@orkestrel/emitter");
|
|
4
4
|
//#region src/core/constants.ts
|
|
5
5
|
/**
|
|
6
6
|
* Maps each {@link Color} to its SGR foreground parameter — the 8 base colors at 30–37 and their
|
|
@@ -521,7 +521,7 @@ var ConsoleError = class extends Error {
|
|
|
521
521
|
* ```
|
|
522
522
|
*/
|
|
523
523
|
function isConsoleError(value) {
|
|
524
|
-
return value
|
|
524
|
+
return (0, _orkestrel_contract.isInstance)(value, ConsoleError);
|
|
525
525
|
}
|
|
526
526
|
//#endregion
|
|
527
527
|
//#region src/core/helpers.ts
|
|
@@ -1050,12 +1050,12 @@ function renderTreeChildren(nodes, prefix, options) {
|
|
|
1050
1050
|
* ```
|
|
1051
1051
|
*/
|
|
1052
1052
|
function stringifyValue(value) {
|
|
1053
|
-
if (
|
|
1054
|
-
if (
|
|
1053
|
+
if ((0, _orkestrel_contract.isError)(value)) return `${value.name}: ${value.message}`;
|
|
1054
|
+
if (!(0, _orkestrel_contract.isObject)(value)) return String(value);
|
|
1055
1055
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
1056
1056
|
try {
|
|
1057
1057
|
return JSON.stringify(value, (_key, nested) => {
|
|
1058
|
-
if (
|
|
1058
|
+
if ((0, _orkestrel_contract.isObject)(nested)) {
|
|
1059
1059
|
if (seen.has(nested)) return "[Circular]";
|
|
1060
1060
|
seen.add(nested);
|
|
1061
1061
|
}
|
|
@@ -1463,7 +1463,7 @@ var Styler = class Styler {
|
|
|
1463
1463
|
return this.#attribute(attribute).surface;
|
|
1464
1464
|
}
|
|
1465
1465
|
#isSurface(value) {
|
|
1466
|
-
return
|
|
1466
|
+
return (0, _orkestrel_contract.isFunction)(value) && "style" in value && "enabled" in value && "render" in value && "red" in value && "bold" in value;
|
|
1467
1467
|
}
|
|
1468
1468
|
#foreground(color) {
|
|
1469
1469
|
return new Styler(this.#renderer, this.#enabled, Object.freeze({
|