@dereekb/util 8.13.4 → 8.13.5
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [8.13.5](https://github.com/dereekb/dbx-components/compare/v8.13.4-dev...v8.13.5) (2022-07-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [8.13.4](https://github.com/dereekb/dbx-components/compare/v8.13.3-dev...v8.13.4) (2022-07-23)
|
|
6
10
|
|
|
7
11
|
|
package/package.json
CHANGED
|
@@ -15,6 +15,15 @@ export interface ServerErrorResponseData extends ReadableError {
|
|
|
15
15
|
export interface ServerError<T = ServerErrorResponseData> extends ReadableDataError<T> {
|
|
16
16
|
status: number;
|
|
17
17
|
}
|
|
18
|
+
export declare type ErrorMessageOrPartialServerError<T = ServerErrorResponseData> = string | Partial<ReadableDataError | ServerError<T>>;
|
|
19
|
+
/**
|
|
20
|
+
* Converts the input to a Partial ServerError
|
|
21
|
+
*
|
|
22
|
+
* @param message
|
|
23
|
+
*/
|
|
24
|
+
export declare function partialServerError<T = ServerErrorResponseData>(message: string): Partial<ServerError<T>>;
|
|
25
|
+
export declare function partialServerError<T = ServerErrorResponseData>(serverError: Partial<ReadableDataError | ServerError<T>>): Partial<ServerError<T>>;
|
|
26
|
+
export declare function partialServerError<T = ServerErrorResponseData>(messageOrError: Maybe<ErrorMessageOrPartialServerError<T>>): Partial<ServerError<T>>;
|
|
18
27
|
export interface ServerErrorMakeConfig<T> extends ServerError<T>, Partial<CodedError> {
|
|
19
28
|
}
|
|
20
29
|
export declare function serverError<T>(config: ServerErrorMakeConfig<T>): ServerError<T>;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnauthorizedServerErrorResponse = exports.ServerErrorResponse = exports.serverError = void 0;
|
|
3
|
+
exports.UnauthorizedServerErrorResponse = exports.ServerErrorResponse = exports.serverError = exports.partialServerError = void 0;
|
|
4
|
+
function partialServerError(messageOrError) {
|
|
5
|
+
var _a;
|
|
6
|
+
let serverError;
|
|
7
|
+
if (typeof messageOrError === 'string') {
|
|
8
|
+
serverError = { message: messageOrError };
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
serverError = (_a = messageOrError) !== null && _a !== void 0 ? _a : {};
|
|
12
|
+
}
|
|
13
|
+
return serverError;
|
|
14
|
+
}
|
|
15
|
+
exports.partialServerError = partialServerError;
|
|
4
16
|
function serverError(config) {
|
|
5
17
|
return Object.assign(Object.assign({}, config), { data: config.data });
|
|
6
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.server.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/error/error.server.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"error.server.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/error/error.server.ts"],"names":[],"mappings":";;;AA8BA,SAAgB,kBAAkB,CAA8B,cAA0D;;IACxH,IAAI,WAA2C,CAAC;IAEhD,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QACtC,WAAW,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;KAC3C;SAAM;QACL,WAAW,GAAG,MAAC,cAA0C,mCAAI,EAAE,CAAC;KACjE;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAVD,gDAUC;AAID,SAAgB,WAAW,CAAI,MAAgC;IAC7D,uCACK,MAAM,KACT,IAAI,EAAE,MAAM,CAAC,IAAI,IACjB;AACJ,CAAC;AALD,kCAKC;AAED;;GAEG;AACH,MAAa,mBAAmB;IAM9B,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAkB;QACzD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAZD,kDAYC;AAED,MAAa,+BAAgC,SAAQ,mBAAmB;IACtE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAwB;QACvD,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;CACF;AAJD,0EAIC"}
|
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [8.13.5](https://github.com/dereekb/dbx-components/compare/v8.13.4-dev...v8.13.5) (2022-07-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [8.13.4](https://github.com/dereekb/dbx-components/compare/v8.13.3-dev...v8.13.4) (2022-07-23)
|
|
6
10
|
|
|
7
11
|
|
package/test/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/util/test",
|
|
3
|
-
"version": "8.13.
|
|
3
|
+
"version": "8.13.5",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@dereekb/util": "8.13.
|
|
9
|
+
"@dereekb/util": "8.13.5",
|
|
10
10
|
"make-error": "^1.3.0",
|
|
11
11
|
"ts-essentials": "^9.1.2",
|
|
12
12
|
"extra-set": "^2.2.11",
|