@chubbyts/chubbyts-throwable-to-error 1.2.0 → 2.0.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 +6 -4
- package/dist/{throwable-to-error.cjs → cjs/throwable-to-error.js} +1 -0
- package/dist/cjs/throwable-to-error.js.map +1 -0
- package/dist/{throwable-to-error.js → esm/throwable-to-error.js} +1 -0
- package/dist/esm/throwable-to-error.js.map +1 -0
- package/package.json +20 -32
- /package/dist/{throwable-to-error.d.ts → types/throwable-to-error.d.ts} +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/chubbyts/chubbyts-throwable-to-error/actions?query=workflow%3ACI)
|
|
4
4
|
[](https://coveralls.io/github/chubbyts/chubbyts-throwable-to-error?branch=master)
|
|
5
|
-
[](https://dashboard.stryker-mutator.io/reports/github.com/chubbyts/chubbyts-throwable-to-error/master)
|
|
6
6
|
[](https://www.npmjs.com/package/@chubbyts/chubbyts-throwable-to-error)
|
|
7
7
|
|
|
8
8
|
[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-throwable-to-error)
|
|
@@ -23,19 +23,21 @@ It converts any throwable into an Error.
|
|
|
23
23
|
|
|
24
24
|
## Requirements
|
|
25
25
|
|
|
26
|
-
* node:
|
|
26
|
+
* node: 18
|
|
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@^
|
|
33
|
+
npm i @chubbyts/chubbyts-throwable-to-error@^2.0.0
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## Usage
|
|
37
37
|
|
|
38
38
|
```ts
|
|
39
|
+
import { throwableToError } from '@chubbyts/chubbyts-throwable-to-error/throwable-to-error';
|
|
40
|
+
|
|
39
41
|
try {
|
|
40
42
|
throw {key: 'value'};
|
|
41
43
|
} catch (e) {
|
|
@@ -45,6 +47,6 @@ try {
|
|
|
45
47
|
|
|
46
48
|
## Copyright
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
2024 Dominik Zogg
|
|
49
51
|
|
|
50
52
|
[1]: https://www.npmjs.com/package/@chubbyts/chubbyts-throwable-to-error
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throwable-to-error.js","sourceRoot":"","sources":["../../src/throwable-to-error.ts"],"names":[],"mappings":";;;AAAO,MAAM,gBAAgB,GAAG,CAAC,CAAU,EAAS,EAAE;IACpD,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;QACvB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACzF,qDAAqD;IACrD,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;IACtB,qDAAqD;IACrD,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;IAExB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAZW,QAAA,gBAAgB,oBAY3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throwable-to-error.js","sourceRoot":"","sources":["../../src/throwable-to-error.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAU,EAAS,EAAE;IACpD,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;QACvB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACzF,qDAAqD;IACrD,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;IACtB,qDAAqD;IACrD,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;IAExB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chubbyts/chubbyts-throwable-to-error",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"description": "It converts any throwable into an Error.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"chubbyts",
|
|
@@ -12,26 +12,17 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": "chubbyts/chubbyts-throwable-to-error",
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "
|
|
15
|
+
"build:cjs": "tsc --module CommonJS --outDir dist/cjs",
|
|
16
|
+
"build:esm": "tsc --module ESNext --outDir dist/esm",
|
|
17
|
+
"build:types": "tsc --declaration --emitDeclarationOnly --outDir dist/types",
|
|
18
|
+
"build": "npm run build:cjs && npm run build:esm && npm run build:types",
|
|
16
19
|
"cs-fix": "prettier --write src tests",
|
|
17
20
|
"cs": "prettier --check src tests",
|
|
18
21
|
"infection": "stryker run",
|
|
19
|
-
"lint-fix": "eslint src tests --fix",
|
|
22
|
+
"lint-fix": "eslint src tests eslint.config.mjs --fix",
|
|
20
23
|
"lint": "eslint src tests",
|
|
21
24
|
"prepare": "npm run build",
|
|
22
|
-
"test": "
|
|
23
|
-
},
|
|
24
|
-
"jest": {
|
|
25
|
-
"preset": "ts-jest",
|
|
26
|
-
"testEnvironment": "node",
|
|
27
|
-
"collectCoverageFrom": [
|
|
28
|
-
"src/**/*.ts"
|
|
29
|
-
],
|
|
30
|
-
"coverageThreshold": {
|
|
31
|
-
"global": {
|
|
32
|
-
"lines": 100
|
|
33
|
-
}
|
|
34
|
-
}
|
|
25
|
+
"test": "vitest"
|
|
35
26
|
},
|
|
36
27
|
"prettier": {
|
|
37
28
|
"printWidth": 120,
|
|
@@ -44,27 +35,24 @@
|
|
|
44
35
|
],
|
|
45
36
|
"exports": {
|
|
46
37
|
"./*": {
|
|
47
|
-
"types": "
|
|
48
|
-
"require": "
|
|
49
|
-
"import": "
|
|
50
|
-
"default": "
|
|
38
|
+
"types": "./dist/types/*.d.ts",
|
|
39
|
+
"require": "./dist/cjs/*.js",
|
|
40
|
+
"import": "./dist/esm/*.js",
|
|
41
|
+
"default": "./dist/esm/*.js"
|
|
51
42
|
}
|
|
52
43
|
},
|
|
53
44
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
45
|
+
"node": ">=18"
|
|
55
46
|
},
|
|
56
|
-
"dependencies": {},
|
|
57
47
|
"devDependencies": {
|
|
58
|
-
"@chubbyts/chubbyts-eslint": "^
|
|
59
|
-
"@
|
|
60
|
-
"@stryker-mutator/
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"ts-jest": "^29.1.1",
|
|
67
|
-
"typescript": "^5.1.6"
|
|
48
|
+
"@chubbyts/chubbyts-eslint": "^3.0.0",
|
|
49
|
+
"@stryker-mutator/core": "^8.7.1",
|
|
50
|
+
"@stryker-mutator/vitest-runner": "^8.7.1",
|
|
51
|
+
"@types/node": "^22.10.2",
|
|
52
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
53
|
+
"prettier": "^3.4.2",
|
|
54
|
+
"typescript": "^5.7.2",
|
|
55
|
+
"vitest": "^2.1.8"
|
|
68
56
|
},
|
|
69
57
|
"publishConfig": {
|
|
70
58
|
"access": "public"
|
|
File without changes
|