@chubbyts/chubbyts-throwable-to-error 1.0.0 → 1.1.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/README.md +3 -3
- package/dist/throwable-to-error.js +2 -0
- package/package.json +15 -12
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -23,14 +23,14 @@ It converts any throwable into an Error.
|
|
|
23
23
|
|
|
24
24
|
## Requirements
|
|
25
25
|
|
|
26
|
-
* node:
|
|
26
|
+
* node: 16
|
|
27
27
|
|
|
28
28
|
## Installation
|
|
29
29
|
|
|
30
30
|
Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-throwable-to-error][1].
|
|
31
31
|
|
|
32
32
|
```ts
|
|
33
|
-
npm i @chubbyts/chubbyts-throwable-to-error@^1.
|
|
33
|
+
npm i @chubbyts/chubbyts-throwable-to-error@^1.1.0
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## Usage
|
|
@@ -45,6 +45,6 @@ try {
|
|
|
45
45
|
|
|
46
46
|
## Copyright
|
|
47
47
|
|
|
48
|
-
Dominik Zogg
|
|
48
|
+
2023 Dominik Zogg
|
|
49
49
|
|
|
50
50
|
[1]: https://www.npmjs.com/package/@chubbyts/chubbyts-throwable-to-error
|
|
@@ -6,7 +6,9 @@ const throwableToError = (e) => {
|
|
|
6
6
|
return e;
|
|
7
7
|
}
|
|
8
8
|
const error = new Error(typeof e === 'object' ? `${JSON.stringify(e)}` : `${String(e)}`);
|
|
9
|
+
// eslint-disable-next-line functional/immutable-data
|
|
9
10
|
error.name = typeof e;
|
|
11
|
+
// eslint-disable-next-line functional/immutable-data
|
|
10
12
|
error.stack = undefined;
|
|
11
13
|
return error;
|
|
12
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chubbyts/chubbyts-throwable-to-error",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "It converts any throwable into an Error.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chubbyts",
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"cs-fix": "prettier --write src tests",
|
|
15
15
|
"cs": "prettier --check src tests",
|
|
16
|
+
"lint-fix": "eslint src tests --fix",
|
|
17
|
+
"lint": "eslint src tests",
|
|
16
18
|
"test": "jest",
|
|
17
19
|
"infection": "stryker run",
|
|
18
|
-
"build": "tsc",
|
|
19
|
-
"prepare": "
|
|
20
|
+
"build": "rm -Rf dist && tsc",
|
|
21
|
+
"prepare": "npm run build"
|
|
20
22
|
},
|
|
21
23
|
"jest": {
|
|
22
24
|
"preset": "ts-jest",
|
|
@@ -40,18 +42,19 @@
|
|
|
40
42
|
"dist"
|
|
41
43
|
],
|
|
42
44
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
45
|
+
"node": ">=16"
|
|
44
46
|
},
|
|
45
47
|
"dependencies": {},
|
|
46
48
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@stryker-mutator/
|
|
49
|
-
"@
|
|
50
|
-
"@types/
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
49
|
+
"@chubbyts/chubbyts-eslint": "^1.1.1",
|
|
50
|
+
"@stryker-mutator/core": "^6.4.2",
|
|
51
|
+
"@stryker-mutator/jest-runner": "^6.4.2",
|
|
52
|
+
"@types/jest": "^29.5.1",
|
|
53
|
+
"@types/node": "^20.1.1",
|
|
54
|
+
"jest": "^29.5.0",
|
|
55
|
+
"prettier": "^2.8.8",
|
|
56
|
+
"ts-jest": "^29.1.0",
|
|
57
|
+
"typescript": "^5.0.4"
|
|
55
58
|
},
|
|
56
59
|
"publishConfig": {
|
|
57
60
|
"access": "public"
|