@webiny/error 5.34.8-beta.1 → 5.35.0-beta.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/Error.js +0 -7
- package/Error.js.map +1 -1
- package/index.js +0 -3
- package/index.js.map +1 -1
- package/package.json +5 -4
package/Error.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
class WError extends Error {
|
|
13
10
|
constructor(messageOrOptions, code, data) {
|
|
14
11
|
// TODO in TS 4.6 we can move that into if statements
|
|
15
12
|
super(typeof messageOrOptions === "string" ? messageOrOptions : messageOrOptions.message);
|
|
16
13
|
(0, _defineProperty2.default)(this, "code", null);
|
|
17
14
|
(0, _defineProperty2.default)(this, "data", null);
|
|
18
|
-
|
|
19
15
|
if (typeof messageOrOptions === "string") {
|
|
20
16
|
// super(messageOrOptions); - use after TS 4.6
|
|
21
17
|
this.code = code || null;
|
|
@@ -26,7 +22,6 @@ class WError extends Error {
|
|
|
26
22
|
this.data = messageOrOptions.data || null;
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
|
-
|
|
30
25
|
static from(err, options = {}) {
|
|
31
26
|
return new WError({
|
|
32
27
|
message: err.message || options.message,
|
|
@@ -34,7 +29,5 @@ class WError extends Error {
|
|
|
34
29
|
data: Object.assign({}, err.data, options.data)
|
|
35
30
|
});
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
}
|
|
39
|
-
|
|
40
33
|
exports.default = WError;
|
package/Error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WError","Error","constructor","messageOrOptions","code","data","message","from","err","options","Object","assign"],"sources":["Error.ts"],"sourcesContent":["export interface ErrorOptions<TData = any> {\n message?: string;\n code?: string;\n data?: TData;\n}\n\nexport default class WError<TData = any> extends Error {\n public readonly code: string | null = null;\n public readonly data: TData | null = null;\n\n constructor(message: string, code?: string, data?: TData);\n constructor(options: ErrorOptions<TData>);\n constructor(messageOrOptions: string | ErrorOptions<TData>, code?: string, data?: TData) {\n // TODO in TS 4.6 we can move that into if statements\n super(typeof messageOrOptions === \"string\" ? messageOrOptions : messageOrOptions.message);\n\n if (typeof messageOrOptions === \"string\") {\n // super(messageOrOptions); - use after TS 4.6\n this.code = code || null;\n this.data = data || null;\n } else {\n // super(messageOrOptions.message); - use after TS 4.6\n this.code = messageOrOptions.code || null;\n this.data = messageOrOptions.data || null;\n }\n }\n\n public static from<TData = any>(err: Partial<WError>, options: ErrorOptions<TData> = {}) {\n return new WError({\n message: err.message || options.message,\n code: err.code || options.code,\n data: Object.assign({}, err.data, options.data)\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["WError","Error","constructor","messageOrOptions","code","data","message","from","err","options","Object","assign"],"sources":["Error.ts"],"sourcesContent":["export interface ErrorOptions<TData = any> {\n message?: string;\n code?: string;\n data?: TData;\n}\n\nexport default class WError<TData = any> extends Error {\n public readonly code: string | null = null;\n public readonly data: TData | null = null;\n\n constructor(message: string, code?: string, data?: TData);\n constructor(options: ErrorOptions<TData>);\n constructor(messageOrOptions: string | ErrorOptions<TData>, code?: string, data?: TData) {\n // TODO in TS 4.6 we can move that into if statements\n super(typeof messageOrOptions === \"string\" ? messageOrOptions : messageOrOptions.message);\n\n if (typeof messageOrOptions === \"string\") {\n // super(messageOrOptions); - use after TS 4.6\n this.code = code || null;\n this.data = data || null;\n } else {\n // super(messageOrOptions.message); - use after TS 4.6\n this.code = messageOrOptions.code || null;\n this.data = messageOrOptions.data || null;\n }\n }\n\n public static from<TData = any>(err: Partial<WError>, options: ErrorOptions<TData> = {}) {\n return new WError({\n message: err.message || options.message,\n code: err.code || options.code,\n data: Object.assign({}, err.data, options.data)\n });\n }\n}\n"],"mappings":";;;;;;;;AAMe,MAAMA,MAAM,SAAsBC,KAAK,CAAC;EAMnDC,WAAW,CAACC,gBAA8C,EAAEC,IAAa,EAAEC,IAAY,EAAE;IACrF;IACA,KAAK,CAAC,OAAOF,gBAAgB,KAAK,QAAQ,GAAGA,gBAAgB,GAAGA,gBAAgB,CAACG,OAAO,CAAC;IAAC,4CAPxD,IAAI;IAAA,4CACL,IAAI;IAQrC,IAAI,OAAOH,gBAAgB,KAAK,QAAQ,EAAE;MACtC;MACA,IAAI,CAACC,IAAI,GAAGA,IAAI,IAAI,IAAI;MACxB,IAAI,CAACC,IAAI,GAAGA,IAAI,IAAI,IAAI;IAC5B,CAAC,MAAM;MACH;MACA,IAAI,CAACD,IAAI,GAAGD,gBAAgB,CAACC,IAAI,IAAI,IAAI;MACzC,IAAI,CAACC,IAAI,GAAGF,gBAAgB,CAACE,IAAI,IAAI,IAAI;IAC7C;EACJ;EAEA,OAAcE,IAAI,CAAcC,GAAoB,EAAEC,OAA4B,GAAG,CAAC,CAAC,EAAE;IACrF,OAAO,IAAIT,MAAM,CAAC;MACdM,OAAO,EAAEE,GAAG,CAACF,OAAO,IAAIG,OAAO,CAACH,OAAO;MACvCF,IAAI,EAAEI,GAAG,CAACJ,IAAI,IAAIK,OAAO,CAACL,IAAI;MAC9BC,IAAI,EAAEK,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEH,GAAG,CAACH,IAAI,EAAEI,OAAO,CAACJ,IAAI;IAClD,CAAC,CAAC;EACN;AACJ;AAAC"}
|
package/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -12,8 +11,6 @@ Object.defineProperty(exports, "ErrorOptions", {
|
|
|
12
11
|
}
|
|
13
12
|
});
|
|
14
13
|
exports.default = void 0;
|
|
15
|
-
|
|
16
14
|
var _Error = _interopRequireWildcard(require("./Error"));
|
|
17
|
-
|
|
18
15
|
var _default = _Error.default;
|
|
19
16
|
exports.default = _default;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Error"],"sources":["index.ts"],"sourcesContent":["import Error, { ErrorOptions } from \"./Error\";\n\nexport default Error;\nexport { ErrorOptions };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Error"],"sources":["index.ts"],"sourcesContent":["import Error, { ErrorOptions } from \"./Error\";\n\nexport default Error;\nexport { ErrorOptions };\n"],"mappings":";;;;;;;;;;;;;AAAA;AAA8C,eAE/BA,cAAK;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/error",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.35.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -16,14 +16,15 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@babel/cli": "^7.19.3",
|
|
18
18
|
"@babel/core": "^7.19.3",
|
|
19
|
-
"@webiny/cli": "^5.
|
|
20
|
-
"@webiny/project-utils": "^5.
|
|
19
|
+
"@webiny/cli": "^5.35.0-beta.0",
|
|
20
|
+
"@webiny/project-utils": "^5.35.0-beta.0",
|
|
21
21
|
"rimraf": "^3.0.2",
|
|
22
|
+
"ttypescript": "^1.5.15",
|
|
22
23
|
"typescript": "4.7.4"
|
|
23
24
|
},
|
|
24
25
|
"scripts": {
|
|
25
26
|
"build": "yarn webiny run build",
|
|
26
27
|
"watch": "yarn webiny run watch"
|
|
27
28
|
},
|
|
28
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "8acc9e8892842cabb3980ce0b6432fde55968d5b"
|
|
29
30
|
}
|