@xylabs/error 3.0.7 → 3.0.9
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/index.cjs +6 -7
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +6 -9
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +6 -7
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +6 -9
- package/dist/node/index.js.map +1 -1
- package/package.json +4 -4
package/dist/browser/index.cjs
CHANGED
|
@@ -3,7 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
6
|
var __export = (target, all) => {
|
|
8
7
|
for (var name in all)
|
|
9
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -28,23 +27,23 @@ __export(src_exports, {
|
|
|
28
27
|
module.exports = __toCommonJS(src_exports);
|
|
29
28
|
|
|
30
29
|
// src/isError.ts
|
|
31
|
-
var isError =
|
|
30
|
+
var isError = (error) => {
|
|
32
31
|
return typeof error.message === "string" && typeof error.name === "string";
|
|
33
|
-
}
|
|
32
|
+
};
|
|
34
33
|
|
|
35
34
|
// src/handleError.ts
|
|
36
|
-
var handleError =
|
|
35
|
+
var handleError = (error, handler) => {
|
|
37
36
|
if (isError(error)) {
|
|
38
37
|
return handler(error);
|
|
39
38
|
} else {
|
|
40
39
|
throw error;
|
|
41
40
|
}
|
|
42
|
-
}
|
|
43
|
-
var handleErrorAsync =
|
|
41
|
+
};
|
|
42
|
+
var handleErrorAsync = async (error, handler) => {
|
|
44
43
|
if (isError(error)) {
|
|
45
44
|
return await handler(error);
|
|
46
45
|
} else {
|
|
47
46
|
throw error;
|
|
48
47
|
}
|
|
49
|
-
}
|
|
48
|
+
};
|
|
50
49
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/isError.ts","../../src/handleError.ts"],"sourcesContent":["export * from './handleError'\nexport * from './isError'\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isError = (error: any): error is Error => {\n return typeof error.message === 'string' && typeof error.name === 'string'\n}\n","import { isError } from './isError'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleError = <T>(error: any, handler: (error: Error) => T) => {\n if (isError(error)) {\n return handler(error)\n } else {\n throw error\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleErrorAsync = async <T>(error: any, handler: (error: Error) => Promise<T>) => {\n if (isError(error)) {\n return await handler(error)\n } else {\n throw error\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/isError.ts","../../src/handleError.ts"],"sourcesContent":["export * from './handleError'\nexport * from './isError'\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isError = (error: any): error is Error => {\n return typeof error.message === 'string' && typeof error.name === 'string'\n}\n","import { isError } from './isError'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleError = <T>(error: any, handler: (error: Error) => T) => {\n if (isError(error)) {\n return handler(error)\n } else {\n throw error\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleErrorAsync = async <T>(error: any, handler: (error: Error) => Promise<T>) => {\n if (isError(error)) {\n return await handler(error)\n } else {\n throw error\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCO,IAAM,UAAU,CAAC,UAA+B;AACrD,SAAO,OAAO,MAAM,YAAY,YAAY,OAAO,MAAM,SAAS;AACpE;;;ACAO,IAAM,cAAc,CAAI,OAAY,YAAiC;AAC1E,MAAI,QAAQ,KAAK,GAAG;AAClB,WAAO,QAAQ,KAAK;AAAA,EACtB,OAAO;AACL,UAAM;AAAA,EACR;AACF;AAGO,IAAM,mBAAmB,OAAU,OAAY,YAA0C;AAC9F,MAAI,QAAQ,KAAK,GAAG;AAClB,WAAO,MAAM,QAAQ,KAAK;AAAA,EAC5B,OAAO;AACL,UAAM;AAAA,EACR;AACF;","names":[]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/isError.ts
|
|
5
|
-
var isError =
|
|
2
|
+
var isError = (error) => {
|
|
6
3
|
return typeof error.message === "string" && typeof error.name === "string";
|
|
7
|
-
}
|
|
4
|
+
};
|
|
8
5
|
|
|
9
6
|
// src/handleError.ts
|
|
10
|
-
var handleError =
|
|
7
|
+
var handleError = (error, handler) => {
|
|
11
8
|
if (isError(error)) {
|
|
12
9
|
return handler(error);
|
|
13
10
|
} else {
|
|
14
11
|
throw error;
|
|
15
12
|
}
|
|
16
|
-
}
|
|
17
|
-
var handleErrorAsync =
|
|
13
|
+
};
|
|
14
|
+
var handleErrorAsync = async (error, handler) => {
|
|
18
15
|
if (isError(error)) {
|
|
19
16
|
return await handler(error);
|
|
20
17
|
} else {
|
|
21
18
|
throw error;
|
|
22
19
|
}
|
|
23
|
-
}
|
|
20
|
+
};
|
|
24
21
|
export {
|
|
25
22
|
handleError,
|
|
26
23
|
handleErrorAsync,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/isError.ts","../../src/handleError.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isError = (error: any): error is Error => {\n return typeof error.message === 'string' && typeof error.name === 'string'\n}\n","import { isError } from './isError'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleError = <T>(error: any, handler: (error: Error) => T) => {\n if (isError(error)) {\n return handler(error)\n } else {\n throw error\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleErrorAsync = async <T>(error: any, handler: (error: Error) => Promise<T>) => {\n if (isError(error)) {\n return await handler(error)\n } else {\n throw error\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/isError.ts","../../src/handleError.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isError = (error: any): error is Error => {\n return typeof error.message === 'string' && typeof error.name === 'string'\n}\n","import { isError } from './isError'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleError = <T>(error: any, handler: (error: Error) => T) => {\n if (isError(error)) {\n return handler(error)\n } else {\n throw error\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleErrorAsync = async <T>(error: any, handler: (error: Error) => Promise<T>) => {\n if (isError(error)) {\n return await handler(error)\n } else {\n throw error\n }\n}\n"],"mappings":";AACO,IAAM,UAAU,CAAC,UAA+B;AACrD,SAAO,OAAO,MAAM,YAAY,YAAY,OAAO,MAAM,SAAS;AACpE;;;ACAO,IAAM,cAAc,CAAI,OAAY,YAAiC;AAC1E,MAAI,QAAQ,KAAK,GAAG;AAClB,WAAO,QAAQ,KAAK;AAAA,EACtB,OAAO;AACL,UAAM;AAAA,EACR;AACF;AAGO,IAAM,mBAAmB,OAAU,OAAY,YAA0C;AAC9F,MAAI,QAAQ,KAAK,GAAG;AAClB,WAAO,MAAM,QAAQ,KAAK;AAAA,EAC5B,OAAO;AACL,UAAM;AAAA,EACR;AACF;","names":[]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -3,7 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
6
|
var __export = (target, all) => {
|
|
8
7
|
for (var name in all)
|
|
9
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -28,25 +27,25 @@ __export(src_exports, {
|
|
|
28
27
|
module.exports = __toCommonJS(src_exports);
|
|
29
28
|
|
|
30
29
|
// src/isError.ts
|
|
31
|
-
var isError =
|
|
30
|
+
var isError = (error) => {
|
|
32
31
|
return typeof error.message === "string" && typeof error.name === "string";
|
|
33
|
-
}
|
|
32
|
+
};
|
|
34
33
|
|
|
35
34
|
// src/handleError.ts
|
|
36
|
-
var handleError =
|
|
35
|
+
var handleError = (error, handler) => {
|
|
37
36
|
if (isError(error)) {
|
|
38
37
|
return handler(error);
|
|
39
38
|
} else {
|
|
40
39
|
throw error;
|
|
41
40
|
}
|
|
42
|
-
}
|
|
43
|
-
var handleErrorAsync =
|
|
41
|
+
};
|
|
42
|
+
var handleErrorAsync = async (error, handler) => {
|
|
44
43
|
if (isError(error)) {
|
|
45
44
|
return await handler(error);
|
|
46
45
|
} else {
|
|
47
46
|
throw error;
|
|
48
47
|
}
|
|
49
|
-
}
|
|
48
|
+
};
|
|
50
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
51
50
|
0 && (module.exports = {
|
|
52
51
|
handleError,
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/isError.ts","../../src/handleError.ts"],"sourcesContent":["export * from './handleError'\nexport * from './isError'\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isError = (error: any): error is Error => {\n return typeof error.message === 'string' && typeof error.name === 'string'\n}\n","import { isError } from './isError'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleError = <T>(error: any, handler: (error: Error) => T) => {\n if (isError(error)) {\n return handler(error)\n } else {\n throw error\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleErrorAsync = async <T>(error: any, handler: (error: Error) => Promise<T>) => {\n if (isError(error)) {\n return await handler(error)\n } else {\n throw error\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/isError.ts","../../src/handleError.ts"],"sourcesContent":["export * from './handleError'\nexport * from './isError'\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isError = (error: any): error is Error => {\n return typeof error.message === 'string' && typeof error.name === 'string'\n}\n","import { isError } from './isError'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleError = <T>(error: any, handler: (error: Error) => T) => {\n if (isError(error)) {\n return handler(error)\n } else {\n throw error\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleErrorAsync = async <T>(error: any, handler: (error: Error) => Promise<T>) => {\n if (isError(error)) {\n return await handler(error)\n } else {\n throw error\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCO,IAAM,UAAU,CAAC,UAA+B;AACrD,SAAO,OAAO,MAAM,YAAY,YAAY,OAAO,MAAM,SAAS;AACpE;;;ACAO,IAAM,cAAc,CAAI,OAAY,YAAiC;AAC1E,MAAI,QAAQ,KAAK,GAAG;AAClB,WAAO,QAAQ,KAAK;AAAA,EACtB,OAAO;AACL,UAAM;AAAA,EACR;AACF;AAGO,IAAM,mBAAmB,OAAU,OAAY,YAA0C;AAC9F,MAAI,QAAQ,KAAK,GAAG;AAClB,WAAO,MAAM,QAAQ,KAAK;AAAA,EAC5B,OAAO;AACL,UAAM;AAAA,EACR;AACF;","names":[]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/isError.ts
|
|
5
|
-
var isError =
|
|
2
|
+
var isError = (error) => {
|
|
6
3
|
return typeof error.message === "string" && typeof error.name === "string";
|
|
7
|
-
}
|
|
4
|
+
};
|
|
8
5
|
|
|
9
6
|
// src/handleError.ts
|
|
10
|
-
var handleError =
|
|
7
|
+
var handleError = (error, handler) => {
|
|
11
8
|
if (isError(error)) {
|
|
12
9
|
return handler(error);
|
|
13
10
|
} else {
|
|
14
11
|
throw error;
|
|
15
12
|
}
|
|
16
|
-
}
|
|
17
|
-
var handleErrorAsync =
|
|
13
|
+
};
|
|
14
|
+
var handleErrorAsync = async (error, handler) => {
|
|
18
15
|
if (isError(error)) {
|
|
19
16
|
return await handler(error);
|
|
20
17
|
} else {
|
|
21
18
|
throw error;
|
|
22
19
|
}
|
|
23
|
-
}
|
|
20
|
+
};
|
|
24
21
|
export {
|
|
25
22
|
handleError,
|
|
26
23
|
handleErrorAsync,
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/isError.ts","../../src/handleError.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isError = (error: any): error is Error => {\n return typeof error.message === 'string' && typeof error.name === 'string'\n}\n","import { isError } from './isError'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleError = <T>(error: any, handler: (error: Error) => T) => {\n if (isError(error)) {\n return handler(error)\n } else {\n throw error\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleErrorAsync = async <T>(error: any, handler: (error: Error) => Promise<T>) => {\n if (isError(error)) {\n return await handler(error)\n } else {\n throw error\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/isError.ts","../../src/handleError.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isError = (error: any): error is Error => {\n return typeof error.message === 'string' && typeof error.name === 'string'\n}\n","import { isError } from './isError'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleError = <T>(error: any, handler: (error: Error) => T) => {\n if (isError(error)) {\n return handler(error)\n } else {\n throw error\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const handleErrorAsync = async <T>(error: any, handler: (error: Error) => Promise<T>) => {\n if (isError(error)) {\n return await handler(error)\n } else {\n throw error\n }\n}\n"],"mappings":";AACO,IAAM,UAAU,CAAC,UAA+B;AACrD,SAAO,OAAO,MAAM,YAAY,YAAY,OAAO,MAAM,SAAS;AACpE;;;ACAO,IAAM,cAAc,CAAI,OAAY,YAAiC;AAC1E,MAAI,QAAQ,KAAK,GAAG;AAClB,WAAO,QAAQ,KAAK;AAAA,EACtB,OAAO;AACL,UAAM;AAAA,EACR;AACF;AAGO,IAAM,mBAAmB,OAAU,OAAY,YAA0C;AAC9F,MAAI,QAAQ,KAAK,GAAG;AAClB,WAAO,MAAM,QAAQ,KAAK;AAAA,EAC5B,OAAO;AACL,UAAM;AAAA,EACR;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
15
|
-
"@xylabs/tsconfig": "^3.
|
|
16
|
-
"@xylabs/tsconfig-jest": "^3.
|
|
14
|
+
"@xylabs/ts-scripts-yarn3": "^3.5.0",
|
|
15
|
+
"@xylabs/tsconfig": "^3.5.0",
|
|
16
|
+
"@xylabs/tsconfig-jest": "^3.5.0",
|
|
17
17
|
"typescript": "^5.4.2"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
@@ -64,6 +64,6 @@
|
|
|
64
64
|
"esm"
|
|
65
65
|
],
|
|
66
66
|
"sideEffects": false,
|
|
67
|
-
"version": "3.0.
|
|
67
|
+
"version": "3.0.9",
|
|
68
68
|
"type": "module"
|
|
69
69
|
}
|