@alessiofrittoli/exception 4.0.0 → 4.1.1
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/README.md +3 -3
- package/dist/abort/index.cjs +1 -1
- package/dist/abort/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +100 -100
package/README.md
CHANGED
|
@@ -9,8 +9,8 @@ This documentation describes the <code>Exception</code> class, which provides a
|
|
|
9
9
|
<a href="https://npmjs.org/package/@alessiofrittoli/exception">
|
|
10
10
|
<img src="https://img.shields.io/npm/v/@alessiofrittoli/exception" alt="Latest version"/>
|
|
11
11
|
</a>
|
|
12
|
-
<a href="https://coveralls.io/github/alessiofrittoli/
|
|
13
|
-
<img src="https://coveralls.io/repos/github/alessiofrittoli/
|
|
12
|
+
<a href="https://coveralls.io/github/alessiofrittoli/exception">
|
|
13
|
+
<img src="https://coveralls.io/repos/github/alessiofrittoli/exception/badge.svg" alt="Test coverage"/>
|
|
14
14
|
</a>
|
|
15
15
|
<a href="https://socket.dev/npm/package/@alessiofrittoli/exception/overview">
|
|
16
16
|
<img src="https://socket.dev/api/badge/npm/package/@alessiofrittoli/exception" alt="Socket Security score"/>
|
|
@@ -21,7 +21,7 @@ This documentation describes the <code>Exception</code> class, which provides a
|
|
|
21
21
|
<a href="https://bundlephobia.com/package/@alessiofrittoli/exception">
|
|
22
22
|
<img src="https://badgen.net/bundlephobia/dependency-count/@alessiofrittoli/exception" alt="Dependencies"/>
|
|
23
23
|
</a>
|
|
24
|
-
<a href="https://libraries.io/npm/%40alessiofrittoli%
|
|
24
|
+
<a href="https://libraries.io/npm/%40alessiofrittoli%2Fexception">
|
|
25
25
|
<img src="https://img.shields.io/librariesio/release/npm/@alessiofrittoli/exception" alt="Dependencies status"/>
|
|
26
26
|
</a>
|
|
27
27
|
</p>
|
package/dist/abort/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../code/index.cjs"),t=require("../index.cjs");var n=class extends t.Exception{constructor(n={}){let{code:r=e.ErrorCode.ABORT
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../code/index.cjs"),t=require("../index.cjs");var n=class extends t.Exception{constructor(n={}){let{code:r=e.ErrorCode.ABORT,message:i=`signal is aborted without reason`,...a}=n;super({...a,name:t.ExceptionName.AbortError,message:i,code:r})}static isAbortError(e,t){return super.isAbortError(e,t)}};exports.AbortError=n;
|
package/dist/abort/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ErrorCode as e}from"../code/index.mjs";import{Exception as t,ExceptionName as n}from"../index.mjs";var r=class extends t{constructor(t={}){let{code:r=e.ABORT
|
|
1
|
+
import{ErrorCode as e}from"../code/index.mjs";import{Exception as t,ExceptionName as n}from"../index.mjs";var r=class extends t{constructor(t={}){let{code:r=e.ABORT,message:i=`signal is aborted without reason`,...a}=t;super({...a,name:n.AbortError,message:i,code:r})}static isAbortError(e,t){return super.isAbortError(e,t)}};export{r as AbortError};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./code/index.cjs"),t={Exception:`Exception`,AbortError:`AbortError`,NotAllowedError:`NotAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InvalidStateError:`InvalidStateError`,InvalidAccessError:`InvalidAccessError`,NetworkError:`NetworkError`,SecurityError:`SecurityError`,TimeoutError:`TimeoutError`,QuotaExceededError:`QuotaExceededError`,DataError:`DataError`,EncodingError:`EncodingError`,OperationError:`OperationError`,ConstraintError:`ConstraintError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,NoModificationAllowedError:`NoModificationAllowedError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NamespaceError:`NamespaceError`,SyntaxError:`SyntaxError`,DataCloneError:`DataCloneError`,URLMismatchError:`URLMismatchError`,InvalidModificationError:`InvalidModificationError`,NotReadableError:`NotReadableError`};var n=class n extends Error{__typename=t.Exception;name=this.__typename;message;title;description;code;isCritical;status;cause;constructor(e){let{message:t=`Unknown error.`}=e;super(t),e.name&&(this.name=e.name),this.message=t,this.title=e.title,this.description=e.description,this.code=e.code,this.isCritical=e.isCritical??!1,this.status=e.status,this.cause=n.isException(e.cause)?new n(e.cause):e.cause}static isException(e){return e instanceof n
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./code/index.cjs"),t={Exception:`Exception`,AbortError:`AbortError`,NotAllowedError:`NotAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InvalidStateError:`InvalidStateError`,InvalidAccessError:`InvalidAccessError`,NetworkError:`NetworkError`,SecurityError:`SecurityError`,TimeoutError:`TimeoutError`,QuotaExceededError:`QuotaExceededError`,DataError:`DataError`,EncodingError:`EncodingError`,OperationError:`OperationError`,ConstraintError:`ConstraintError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,NoModificationAllowedError:`NoModificationAllowedError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NamespaceError:`NamespaceError`,SyntaxError:`SyntaxError`,DataCloneError:`DataCloneError`,URLMismatchError:`URLMismatchError`,InvalidModificationError:`InvalidModificationError`,NotReadableError:`NotReadableError`};var n=class n extends Error{__typename=t.Exception;name=this.__typename;message;title;description;code;isCritical;status;cause;constructor(e){let{message:t=`Unknown error.`}=e;super(t),e.name&&(this.name=e.name),this.message=t,this.title=e.title,this.description=e.description,this.code=e.code,this.isCritical=e.isCritical??!1,this.status=e.status,this.cause=n.isException(e.cause)?new n(e.cause):e.cause}static isException(e){return e instanceof n||!!e&&typeof e==`object`&&`__typename`in e&&e.__typename===t.Exception}static isAbortError(r,i=e.ErrorCode.ABORT){return n.isException(r)&&(r.name===t.AbortError||r.code===i)}toJSON(){return{...this,message:this.message,cause:this.cause}}};exports.Exception=n,exports.ExceptionName=t;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ErrorCode as e}from"./code/index.mjs";const t={Exception:`Exception`,AbortError:`AbortError`,NotAllowedError:`NotAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InvalidStateError:`InvalidStateError`,InvalidAccessError:`InvalidAccessError`,NetworkError:`NetworkError`,SecurityError:`SecurityError`,TimeoutError:`TimeoutError`,QuotaExceededError:`QuotaExceededError`,DataError:`DataError`,EncodingError:`EncodingError`,OperationError:`OperationError`,ConstraintError:`ConstraintError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,NoModificationAllowedError:`NoModificationAllowedError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NamespaceError:`NamespaceError`,SyntaxError:`SyntaxError`,DataCloneError:`DataCloneError`,URLMismatchError:`URLMismatchError`,InvalidModificationError:`InvalidModificationError`,NotReadableError:`NotReadableError`};var n=class n extends Error{__typename=t.Exception;name=this.__typename;message;title;description;code;isCritical;status;cause;constructor(e){let{message:t=`Unknown error.`}=e;super(t),e.name&&(this.name=e.name),this.message=t,this.title=e.title,this.description=e.description,this.code=e.code,this.isCritical=e.isCritical??!1,this.status=e.status,this.cause=n.isException(e.cause)?new n(e.cause):e.cause}static isException(e){return e instanceof n
|
|
1
|
+
import{ErrorCode as e}from"./code/index.mjs";const t={Exception:`Exception`,AbortError:`AbortError`,NotAllowedError:`NotAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InvalidStateError:`InvalidStateError`,InvalidAccessError:`InvalidAccessError`,NetworkError:`NetworkError`,SecurityError:`SecurityError`,TimeoutError:`TimeoutError`,QuotaExceededError:`QuotaExceededError`,DataError:`DataError`,EncodingError:`EncodingError`,OperationError:`OperationError`,ConstraintError:`ConstraintError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,NoModificationAllowedError:`NoModificationAllowedError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NamespaceError:`NamespaceError`,SyntaxError:`SyntaxError`,DataCloneError:`DataCloneError`,URLMismatchError:`URLMismatchError`,InvalidModificationError:`InvalidModificationError`,NotReadableError:`NotReadableError`};var n=class n extends Error{__typename=t.Exception;name=this.__typename;message;title;description;code;isCritical;status;cause;constructor(e){let{message:t=`Unknown error.`}=e;super(t),e.name&&(this.name=e.name),this.message=t,this.title=e.title,this.description=e.description,this.code=e.code,this.isCritical=e.isCritical??!1,this.status=e.status,this.cause=n.isException(e.cause)?new n(e.cause):e.cause}static isException(e){return e instanceof n||!!e&&typeof e==`object`&&`__typename`in e&&e.__typename===t.Exception}static isAbortError(r,i=e.ABORT){return n.isException(r)&&(r.name===t.AbortError||r.code===i)}toJSON(){return{...this,message:this.message,cause:this.cause}}};export{n as Exception,t as ExceptionName};
|
package/package.json
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
2
|
+
"name": "@alessiofrittoli/exception",
|
|
3
|
+
"version": "4.1.1",
|
|
4
|
+
"description": "Handle errors with ease",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Alessio Frittoli",
|
|
8
|
+
"email": "info@alessiofrittoli.it",
|
|
9
|
+
"url": "https://alessiofrittoli.it"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"funding": [
|
|
13
|
+
{
|
|
14
|
+
"type": "github",
|
|
15
|
+
"url": "https://github.com/sponsors/alessiofrittoli"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"exceptions",
|
|
20
|
+
"errors"
|
|
21
|
+
],
|
|
22
|
+
"homepage": "https://github.com/alessiofrittoli/exception#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/alessiofrittoli/exception/issues",
|
|
25
|
+
"email": "info@alessiofrittoli.it"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/alessiofrittoli/exception.git"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=24.15.0",
|
|
33
|
+
"pnpm": ">=11.27.1"
|
|
34
|
+
},
|
|
35
|
+
"main": "./dist/index.cjs",
|
|
36
|
+
"module": "./dist/index.mjs",
|
|
37
|
+
"types": "./dist/index.d.mts",
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/index.d.mts",
|
|
45
|
+
"default": "./dist/index.mjs"
|
|
46
|
+
},
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./dist/index.d.cts",
|
|
49
|
+
"default": "./dist/index.cjs"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"./*": {
|
|
53
|
+
"import": {
|
|
54
|
+
"types": "./dist/*/index.d.mts",
|
|
55
|
+
"default": "./dist/*/index.mjs"
|
|
56
|
+
},
|
|
57
|
+
"require": {
|
|
58
|
+
"types": "./dist/*/index.d.cts",
|
|
59
|
+
"default": "./dist/*/index.cjs"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"sideEffects": false,
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@alessiofrittoli/node-scripts": "^4.0.0-alpha.3",
|
|
66
|
+
"@alessiofrittoli/package-configs": "^1.6.0",
|
|
67
|
+
"@types/node": "^24.19.1",
|
|
68
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
69
|
+
"concurrently": "^9.2.1",
|
|
70
|
+
"http-server": "^14.1.1",
|
|
71
|
+
"oxlint": "^1.86.0",
|
|
72
|
+
"prettier": "^3.9.9",
|
|
73
|
+
"prettier-plugin-sort-imports": "^1.8.11",
|
|
74
|
+
"tsdown": "^0.23.0",
|
|
75
|
+
"typescript": "^6.0.3",
|
|
76
|
+
"vite": "^8.3.2",
|
|
77
|
+
"vitest": "^5.0.3"
|
|
78
|
+
},
|
|
79
|
+
"scripts": {
|
|
80
|
+
"//1a": "*********************************************************************",
|
|
81
|
+
"//1b": "******************** DEV - BUILD - LINT - RELEASE *******************",
|
|
82
|
+
"//1c": "*********************************************************************",
|
|
83
|
+
"dev": "tsdown --watch",
|
|
84
|
+
"build": "pnpm lint && pnpm tsc && pnpm tsdown",
|
|
85
|
+
"lint": "oxlint --report-unused-disable-directives --max-warnings 0",
|
|
86
|
+
"release": "node scripts/release.ts --verbose --npm",
|
|
87
|
+
"//2a": "*********************************************************************",
|
|
88
|
+
"//2b": "***************************** UNIT TESTS ****************************",
|
|
89
|
+
"//2c": "*********************************************************************",
|
|
90
|
+
"test": "vitest --reporter=tree",
|
|
91
|
+
"test:watch": "pnpm test watch",
|
|
92
|
+
"test:ci": "pnpm test run",
|
|
93
|
+
"//3a": "*********************************************************************",
|
|
94
|
+
"//3b": "************************ UNIT TESTS COVERAGE ************************",
|
|
95
|
+
"//3c": "*********************************************************************",
|
|
96
|
+
"test:coverage": "pnpm test:watch --coverage",
|
|
97
|
+
"test:coverage:ci": "pnpm test:ci --coverage",
|
|
98
|
+
"test:serve-coverage": "http-server ./coverage --gzip true -p 0 -o /index.html --silent",
|
|
99
|
+
"test:coverage:serve": "concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\""
|
|
100
|
+
}
|
|
101
|
+
}
|