declapract-typescript-ehmpathy 0.27.2 → 0.28.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/dist/practices/errors/bad-practices/own-implementation/src/utils/errors/UnexpectedCodePathError.ts.declapract.ts +3 -0
- package/dist/practices/errors/best-practice/package.json +5 -0
- package/dist/practices/errors/best-practice/package.json.declapract.ts +4 -0
- package/dist/practices/lambda-handlers/best-practice/package.json +1 -1
- package/dist/practices/linting/best-practice/.depcheckrc.yml +0 -1
- package/dist/practices/testing/best-practice/package.json +1 -0
- package/package.json +1 -1
- package/dist/practices/errors/best-practice/src/utils/errors/UnexpectedCodePathError.ts +0 -14
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"devDependencies": {
|
|
3
3
|
"@types/jest": "@declapract{check.minVersion('29.2.4')}",
|
|
4
4
|
"jest": "@declapract{check.minVersion('29.3.1')}",
|
|
5
|
+
"test-fns": "@declapract{check.minVersion('1.0.0')}",
|
|
5
6
|
"ts-jest": "@declapract{check.minVersion('29.0.3')}",
|
|
6
7
|
"ts-node": "@declapract{check.minVersion('10.9.1')}",
|
|
7
8
|
"core-js": "@declapract{check.minVersion('3.26.1')}",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "declapract-typescript-ehmpathy",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "declapract best practices declarations for typescript",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.28.0",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"repository": "ehmpathy/declapract-typescript-ehmpathy",
|
|
8
8
|
"homepage": "https://github.com/ehmpathy/declapract-typescript-ehmpathy",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UnexpectedCodePath errors are used to indicate that we've reached a code path that should never have been reached
|
|
3
|
-
*
|
|
4
|
-
* Purpose of having a dedicated class for this type of error is to allow us to easily add metadata about what was going on when we reached this code path
|
|
5
|
-
* - e.g., the variables in memory at the time
|
|
6
|
-
*/
|
|
7
|
-
export class UnexpectedCodePathError extends Error {
|
|
8
|
-
constructor(message: string, metadata?: Record<string, any>) {
|
|
9
|
-
const fullMessage = `UnexpectedCodePath: ${message}${
|
|
10
|
-
metadata ? `\n\n${JSON.stringify(metadata)}` : ''
|
|
11
|
-
}`;
|
|
12
|
-
super(fullMessage);
|
|
13
|
-
}
|
|
14
|
-
}
|