@likec4/log 1.46.1 → 1.48.0
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/LICENSE +1 -1
- package/dist/_chunks/libs/is-error-instance.mjs +26 -0
- package/dist/_chunks/libs/is-plain-obj.mjs +9 -0
- package/dist/_chunks/libs/merge-error-cause.mjs +746 -0
- package/dist/_chunks/libs/safe-stringify.mjs +21 -0
- package/dist/index.d.mts +27 -16
- package/dist/index.mjs +189 -1423
- package/package.json +7 -7
- package/src/formatters.ts +28 -20
- package/src/index.ts +7 -3
- package/src/sink.ts +31 -0
package/LICENSE
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/is-error-instance@3.0.1/node_modules/is-error-instance/build/src/main.js
|
|
2
|
+
const isErrorInstance = (value) => isInstanceOfError(value) || hasErrorTag(value);
|
|
3
|
+
var main_default = isErrorInstance;
|
|
4
|
+
const isInstanceOfError = (value) => {
|
|
5
|
+
try {
|
|
6
|
+
return value instanceof Error;
|
|
7
|
+
} catch {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const hasErrorTag = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
return ERROR_TAGS.has(Object.prototype.toString.call(value));
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const ERROR_TAGS = new Set([
|
|
19
|
+
"[object Error]",
|
|
20
|
+
"[object DOMException]",
|
|
21
|
+
"[object DOMError]",
|
|
22
|
+
"[object Exception]"
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { main_default as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
|
|
2
|
+
function isPlainObject(value) {
|
|
3
|
+
if (typeof value !== "object" || value === null) return false;
|
|
4
|
+
const prototype = Object.getPrototypeOf(value);
|
|
5
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { isPlainObject as t };
|