@webiny/error 6.0.0-alpha.5 β 6.0.0-rc.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 +1 -8
- package/Error.js.map +1 -1
- package/README.md +7 -16
- package/index.d.ts +2 -2
- package/index.js +3 -21
- package/index.js.map +1 -1
- package/package.json +6 -9
package/Error.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
class WError extends Error {
|
|
1
|
+
export default class WError extends Error {
|
|
8
2
|
code = null;
|
|
9
3
|
data = null;
|
|
10
4
|
constructor(messageOrOptions, code, data) {
|
|
@@ -28,6 +22,5 @@ class WError extends Error {
|
|
|
28
22
|
});
|
|
29
23
|
}
|
|
30
24
|
}
|
|
31
|
-
exports.default = WError;
|
|
32
25
|
|
|
33
26
|
//# sourceMappingURL=Error.js.map
|
package/Error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WError","Error","code","data","constructor","messageOrOptions","message","from","err","options","Object","assign"
|
|
1
|
+
{"version":3,"names":["WError","Error","code","data","constructor","messageOrOptions","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":"AAMA,eAAe,MAAMA,MAAM,SAAsBC,KAAK,CAAC;EACnCC,IAAI,GAAkB,IAAI;EAC1BC,IAAI,GAAiB,IAAI;EAIzCC,WAAWA,CAACC,gBAA8C,EAAEH,IAAa,EAAEC,IAAY,EAAE;IACrF;IACA,KAAK,CAAC,OAAOE,gBAAgB,KAAK,QAAQ,GAAGA,gBAAgB,GAAGA,gBAAgB,CAACC,OAAO,CAAC;IAEzF,IAAI,OAAOD,gBAAgB,KAAK,QAAQ,EAAE;MACtC;MACA,IAAI,CAACH,IAAI,GAAGA,IAAI,IAAI,IAAI;MACxB,IAAI,CAACC,IAAI,GAAGA,IAAI,IAAI,IAAI;IAC5B,CAAC,MAAM;MACH;MACA,IAAI,CAACD,IAAI,GAAGG,gBAAgB,CAACH,IAAI,IAAI,IAAI;MACzC,IAAI,CAACC,IAAI,GAAGE,gBAAgB,CAACF,IAAI,IAAI,IAAI;IAC7C;EACJ;EAEA,OAAcI,IAAIA,CAAcC,GAAoB,EAAEC,OAA4B,GAAG,CAAC,CAAC,EAAE;IACrF,OAAO,IAAIT,MAAM,CAAC;MACdM,OAAO,EAAEE,GAAG,CAACF,OAAO,IAAIG,OAAO,CAACH,OAAO;MACvCJ,IAAI,EAAEM,GAAG,CAACN,IAAI,IAAIO,OAAO,CAACP,IAAI;MAC9BC,IAAI,EAAEO,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEH,GAAG,CAACL,IAAI,EAAEM,OAAO,CAACN,IAAI;IAClD,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
package/README.md
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
# @webiny/error
|
|
2
|
-
[](https://www.npmjs.com/package/webiny-data)
|
|
3
|
-
[](https://www.npmjs.com/package/webiny-data)
|
|
4
|
-
[](https://github.com/prettier/prettier)
|
|
5
|
-
[](http://makeapullrequest.com)
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> Itβs **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
[the official docs](https://github.com/doitadrian/data).
|
|
11
|
-
|
|
12
|
-
## Install
|
|
13
|
-
```
|
|
14
|
-
npm install --save @webiny/error
|
|
15
|
-
```
|
|
7
|
+
π **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
16
8
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "ErrorOptions", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _Error.ErrorOptions;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "WebinyError", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _Error.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
exports.default = void 0;
|
|
20
|
-
var _Error = _interopRequireWildcard(require("./Error"));
|
|
21
|
-
var _default = exports.default = _Error.default;
|
|
1
|
+
import Error from "./Error.js";
|
|
2
|
+
export { Error as WebinyError };
|
|
3
|
+
export default Error;
|
|
22
4
|
|
|
23
5
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Error","WebinyError"],"sources":["index.ts"],"sourcesContent":["import Error, { type ErrorOptions } from \"./Error.js\";\n\nexport { Error as WebinyError };\nexport default Error;\nexport type { ErrorOptions };\n"],"mappings":"AAAA,OAAOA,KAAK;AAEZ,SAASA,KAAK,IAAIC,WAAW;AAC7B,eAAeD,KAAK","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/error",
|
|
3
|
-
"version": "6.0.0-
|
|
3
|
+
"version": "6.0.0-rc.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "index.js",
|
|
5
6
|
"types": "index.d.ts",
|
|
6
7
|
"repository": {
|
|
@@ -14,13 +15,9 @@
|
|
|
14
15
|
"directory": "dist"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
|
-
"@webiny/
|
|
18
|
-
"rimraf": "6.
|
|
19
|
-
"typescript": "5.
|
|
18
|
+
"@webiny/build-tools": "6.0.0-rc.0",
|
|
19
|
+
"rimraf": "6.1.3",
|
|
20
|
+
"typescript": "5.9.3"
|
|
20
21
|
},
|
|
21
|
-
"
|
|
22
|
-
"build": "node ../cli/bin.js run build",
|
|
23
|
-
"watch": "node ../cli/bin.js run watch"
|
|
24
|
-
},
|
|
25
|
-
"gitHead": "b7e120541b093e91f214904a9f13e4c2c4640978"
|
|
22
|
+
"gitHead": "0f2aa699f4642e550ab62c96fcd050e8d02345c9"
|
|
26
23
|
}
|