error-message-utils 1.1.0 → 1.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/dist/shared/types.d.ts +7 -7
- package/package.json +6 -6
package/dist/shared/types.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* When an error code is inserted into a message (encoding a message), it must be wrapped first so
|
|
4
4
|
* it can be decoded later.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
type IErrorCodeWrapper = {
|
|
7
7
|
prefix: string;
|
|
8
8
|
suffix: string;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
/**
|
|
11
11
|
* Error Code
|
|
12
12
|
* The error's code that is inserted when encoding an error. If none is provided or none can be
|
|
@@ -17,17 +17,17 @@ type IErrorCode = string | number;
|
|
|
17
17
|
* Unwrapped Error Code
|
|
18
18
|
* In order to decode an error, the code must be first unwrapped.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
type IUnwrappedErrorCode = {
|
|
21
21
|
code: IErrorCode;
|
|
22
22
|
startsAt: number;
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
/**
|
|
25
25
|
* Decoded Error
|
|
26
26
|
* The object obtained when an error is decoded. Keep in mind that if the error message or the code
|
|
27
27
|
* cannot be extracted for any reason, the default values will be set instead.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
type IDecodedError = {
|
|
30
30
|
message: string;
|
|
31
31
|
code: IErrorCode;
|
|
32
|
-
}
|
|
33
|
-
export { IErrorCodeWrapper, IErrorCode, IUnwrappedErrorCode, IDecodedError, };
|
|
32
|
+
};
|
|
33
|
+
export type { IErrorCodeWrapper, IErrorCode, IUnwrappedErrorCode, IDecodedError, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "error-message-utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "The error-message-utils package simplifies error management in your web applications and RESTful APIs. It ensures consistent and scalable handling of error messages, saving you time and effort. Moreover, it gives you the ability to assign custom error codes so all possible cases can be handled accordingly.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"homepage": "https://github.com/jesusgraterol/error-message-utils#readme",
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/jest": "^29.5.12",
|
|
41
|
-
"@types/node": "^20.
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
43
|
-
"@typescript-eslint/parser": "^7.
|
|
41
|
+
"@types/node": "^20.14.10",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
43
|
+
"@typescript-eslint/parser": "^7.16.0",
|
|
44
44
|
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
45
45
|
"jest": "^29.7.0",
|
|
46
|
-
"ts-jest": "^29.
|
|
46
|
+
"ts-jest": "^29.2.0",
|
|
47
47
|
"ts-lib-builder": "^1.0.3",
|
|
48
|
-
"typescript": "^5.
|
|
48
|
+
"typescript": "^5.5.3"
|
|
49
49
|
}
|
|
50
50
|
}
|