@alessiofrittoli/exception 2.3.1 → 2.5.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/README.md +21 -18
- package/package.json +32 -20
package/README.md
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
# Exception 🚦
|
|
2
2
|
|
|
3
|
-
[![NPM Latest Version][version-badge]][npm-url] [![Coverage Status][coverage-badge]][coverage-url] [![NPM Monthly Downloads][downloads-badge]][npm-url] [![Dependencies][deps-badge]][deps-url]
|
|
3
|
+
[![NPM Latest Version][version-badge]][npm-url] [![Coverage Status][coverage-badge]][coverage-url] [![Socket Status][socket-badge]][socket-url] [![NPM Monthly Downloads][downloads-badge]][npm-url] [![Dependencies][deps-badge]][deps-url]
|
|
4
|
+
|
|
5
|
+
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
|
|
4
6
|
|
|
5
7
|
[version-badge]: https://img.shields.io/npm/v/%40alessiofrittoli%2Fexception
|
|
6
8
|
[npm-url]: https://npmjs.org/package/%40alessiofrittoli%2Fexception
|
|
7
9
|
[coverage-badge]: https://coveralls.io/repos/github/alessiofrittoli/exception/badge.svg
|
|
8
10
|
[coverage-url]: https://coveralls.io/github/alessiofrittoli/exception
|
|
11
|
+
[socket-badge]: https://socket.dev/api/badge/npm/package/@alessiofrittoli/exception
|
|
12
|
+
[socket-url]: https://socket.dev/npm/package/@alessiofrittoli/exception/overview
|
|
9
13
|
[downloads-badge]: https://img.shields.io/npm/dm/%40alessiofrittoli%2Fexception.svg
|
|
10
14
|
[deps-badge]: https://img.shields.io/librariesio/release/npm/%40alessiofrittoli%2Fexception
|
|
11
15
|
[deps-url]: https://libraries.io/npm/%40alessiofrittoli%2Fexception
|
|
12
16
|
|
|
17
|
+
[sponsor-badge]: https://img.shields.io/static/v1?label=Fund%20this%20package&message=%E2%9D%A4&logo=GitHub&color=%23DB61A2
|
|
18
|
+
[sponsor-url]: https://github.com/sponsors/alessiofrittoli
|
|
19
|
+
|
|
13
20
|
## Handle errors with ease
|
|
14
21
|
|
|
15
22
|
This documentation describes the `Exception` class, which provides a structured way to handle errors in TypeScript. It includes custom properties such as `code`, `name`, and `status` for more detailed error reporting and debugging.
|
|
@@ -22,6 +29,8 @@ This documentation describes the `Exception` class, which provides a structured
|
|
|
22
29
|
- [Exception Class](#exception-class)
|
|
23
30
|
- [Usage Scenarios](#usage-scenarios)
|
|
24
31
|
- [Development](#development)
|
|
32
|
+
- [Install depenendencies](#install-depenendencies)
|
|
33
|
+
- [Build the source code](#build-the-source-code)
|
|
25
34
|
- [ESLint](#eslint)
|
|
26
35
|
- [Jest](#jest)
|
|
27
36
|
- [Contributing](#contributing)
|
|
@@ -273,9 +282,9 @@ or using `pnpm`
|
|
|
273
282
|
pnpm i
|
|
274
283
|
```
|
|
275
284
|
|
|
276
|
-
#### Build
|
|
285
|
+
#### Build the source code
|
|
277
286
|
|
|
278
|
-
Run the following command to build code for distribution.
|
|
287
|
+
Run the following command to test and build code for distribution.
|
|
279
288
|
|
|
280
289
|
```bash
|
|
281
290
|
pnpm build
|
|
@@ -295,24 +304,13 @@ Run all the defined test suites by running the following:
|
|
|
295
304
|
|
|
296
305
|
```bash
|
|
297
306
|
# Run tests and watch file changes.
|
|
298
|
-
pnpm test
|
|
299
|
-
|
|
300
|
-
# Run tests and watch file changes with jest-environment-jsdom.
|
|
301
|
-
pnpm test:jsdom
|
|
307
|
+
pnpm test:watch
|
|
302
308
|
|
|
303
309
|
# Run tests in a CI environment.
|
|
304
310
|
pnpm test:ci
|
|
305
|
-
|
|
306
|
-
# Run tests in a CI environment with jest-environment-jsdom.
|
|
307
|
-
pnpm test:ci:jsdom
|
|
308
311
|
```
|
|
309
312
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
pnpm test:jest
|
|
314
|
-
pnpm test:jest:jsdom
|
|
315
|
-
```
|
|
313
|
+
- See [`package.json`](./package.json) file scripts for more info.
|
|
316
314
|
|
|
317
315
|
Run tests with coverage.
|
|
318
316
|
|
|
@@ -321,16 +319,21 @@ An HTTP server is then started to serve coverage files from `./coverage` folder.
|
|
|
321
319
|
⚠️ You may see a blank page the first time you run this command. Simply refresh the browser to see the updates.
|
|
322
320
|
|
|
323
321
|
```bash
|
|
324
|
-
|
|
322
|
+
test:coverage:serve
|
|
325
323
|
```
|
|
326
324
|
|
|
327
325
|
---
|
|
328
326
|
|
|
329
327
|
### Contributing
|
|
330
328
|
|
|
331
|
-
Contributions are truly welcome
|
|
329
|
+
Contributions are truly welcome!
|
|
330
|
+
|
|
332
331
|
Please refer to the [Contributing Doc](./CONTRIBUTING.md) for more information on how to start contributing to this project.
|
|
333
332
|
|
|
333
|
+
Help keep this project up to date with [GitHub Sponsor][sponsor-url].
|
|
334
|
+
|
|
335
|
+
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
|
|
336
|
+
|
|
334
337
|
---
|
|
335
338
|
|
|
336
339
|
### Security
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alessiofrittoli/exception",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Handle errors with ease",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Alessio Frittoli",
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
"url": "https://alessiofrittoli.it"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
|
+
"funding": [
|
|
12
|
+
{
|
|
13
|
+
"type": "github",
|
|
14
|
+
"url": "https://github.com/sponsors/alessiofrittoli"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
11
17
|
"keywords": [
|
|
12
18
|
"exceptions",
|
|
13
19
|
"errors"
|
|
@@ -41,43 +47,49 @@
|
|
|
41
47
|
},
|
|
42
48
|
"sideEffects": false,
|
|
43
49
|
"scripts": {
|
|
50
|
+
"//1a": "*********************************************************************",
|
|
51
|
+
"//1b": "*********************** BUILD - LINT - RELEASE **********************",
|
|
52
|
+
"//1c": "*********************************************************************",
|
|
44
53
|
"build": "pnpm lint && pnpm test:ci && tsup",
|
|
45
54
|
"build:watch": "tsup --watch",
|
|
46
55
|
"lint": "eslint",
|
|
47
56
|
"release": "node scripts/publish.js --verbose --npm",
|
|
57
|
+
"//2a": "*********************************************************************",
|
|
58
|
+
"//2b": "***************************** UNIT TESTS ****************************",
|
|
59
|
+
"//2c": "*********************************************************************",
|
|
48
60
|
"test": "jest --verbose",
|
|
49
61
|
"test:watch": "jest --watchAll --verbose",
|
|
50
|
-
"test:jsdom": "JSDOM=true pnpm test:watch",
|
|
51
62
|
"test:ci": "jest --ci --verbose",
|
|
52
|
-
"
|
|
63
|
+
"//3a": "*********************************************************************",
|
|
64
|
+
"//3b": "************************ UNIT TESTS COVERAGE ************************",
|
|
65
|
+
"//3c": "*********************************************************************",
|
|
53
66
|
"test:coverage": "pnpm test:watch --coverage",
|
|
54
67
|
"test:ci:coverage": "pnpm test:ci --coverage",
|
|
55
68
|
"test:serve-coverage": "http-server ./coverage/lcov-report --gzip true -p 0 -o --silent",
|
|
56
|
-
"test:coverage:serve": "concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\""
|
|
57
|
-
"test:coverage:jsdom": "JSDOM=true pnpm test:coverage",
|
|
58
|
-
"test:coverage:jsdom:serve": "JSDOM=true pnpm test:coverage:serve",
|
|
59
|
-
"test:jest": "pnpm test:watch jest.test.ts",
|
|
60
|
-
"test:jest:jsdom": "JSDOM=true pnpm test:jest",
|
|
61
|
-
"test:exception": "pnpm test:watch exception.test.ts"
|
|
69
|
+
"test:coverage:serve": "concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\""
|
|
62
70
|
},
|
|
63
71
|
"devDependencies": {
|
|
64
|
-
"@alessiofrittoli/node-scripts": "^2.
|
|
65
|
-
"@eslint/js": "^9.
|
|
72
|
+
"@alessiofrittoli/node-scripts": "^2.4.0",
|
|
73
|
+
"@eslint/js": "^9.22.0",
|
|
66
74
|
"@jest/globals": "^29.7.0",
|
|
67
75
|
"@types/jest": "^29.5.14",
|
|
68
|
-
"@types/node": "^22.13.
|
|
76
|
+
"@types/node": "^22.13.11",
|
|
69
77
|
"concurrently": "^9.1.2",
|
|
70
78
|
"dotenv": "^16.4.7",
|
|
71
|
-
"esbuild": "0.25.
|
|
72
|
-
"eslint": "^9.
|
|
73
|
-
"globals": "^
|
|
79
|
+
"esbuild": "0.25.1",
|
|
80
|
+
"eslint": "^9.22.0",
|
|
81
|
+
"globals": "^16.0.0",
|
|
74
82
|
"http-server": "^14.1.1",
|
|
75
83
|
"jest": "^29.7.0",
|
|
76
|
-
"jest
|
|
77
|
-
"ts-jest": "^29.2.5",
|
|
84
|
+
"ts-jest": "^29.2.6",
|
|
78
85
|
"ts-node": "^10.9.2",
|
|
79
|
-
"tsup": "^8.
|
|
80
|
-
"typescript": "^5.
|
|
81
|
-
"typescript-eslint": "^8.
|
|
86
|
+
"tsup": "^8.4.0",
|
|
87
|
+
"typescript": "^5.8.2",
|
|
88
|
+
"typescript-eslint": "^8.27.0"
|
|
89
|
+
},
|
|
90
|
+
"pnpm": {
|
|
91
|
+
"onlyBuiltDependencies": [
|
|
92
|
+
"esbuild"
|
|
93
|
+
]
|
|
82
94
|
}
|
|
83
95
|
}
|