@onekeyfe/cross-inpage-provider-errors 2.0.0-alpha.8 → 2.0.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/cjs/utils.js CHANGED
@@ -52,7 +52,6 @@ exports.isValidCode = isValidCode;
52
52
  * returned object's data.originalError property.
53
53
  */
54
54
  function serializeError(error, { fallbackError = FALLBACK_ERROR, shouldIncludeStack = false, } = {}) {
55
- var _a, _b;
56
55
  if (!fallbackError ||
57
56
  !Number.isInteger(fallbackError.code) ||
58
57
  typeof fallbackError.message !== 'string') {
@@ -82,13 +81,13 @@ function serializeError(error, { fallbackError = FALLBACK_ERROR, shouldIncludeSt
82
81
  }
83
82
  else {
84
83
  serialized.code = fallbackError.code;
85
- const message = (_a = error) === null || _a === void 0 ? void 0 : _a.message;
84
+ const message = error === null || error === void 0 ? void 0 : error.message;
86
85
  serialized.message = (message && typeof message === 'string'
87
86
  ? message
88
87
  : fallbackError.message);
89
88
  serialized.data = { originalError: assignOriginalError(error) };
90
89
  }
91
- const stack = (_b = error) === null || _b === void 0 ? void 0 : _b.stack;
90
+ const stack = error === null || error === void 0 ? void 0 : error.stack;
92
91
  if (shouldIncludeStack && error && stack && typeof stack === 'string') {
93
92
  serialized.stack = stack;
94
93
  }
package/dist/errors.d.ts CHANGED
@@ -6,8 +6,8 @@ interface Web3ErrorOptions<T> {
6
6
  interface ServerErrorOptions<T> extends Web3ErrorOptions<T> {
7
7
  code: number;
8
8
  }
9
- declare type CustomErrorArg<T> = ServerErrorOptions<T>;
10
- declare type Web3ErrorsArg<T> = Web3ErrorOptions<T> | string;
9
+ type CustomErrorArg<T> = ServerErrorOptions<T>;
10
+ type Web3ErrorsArg<T> = Web3ErrorOptions<T> | string;
11
11
  export declare const web3Errors: {
12
12
  rpc: {
13
13
  /**
package/dist/utils.js CHANGED
@@ -47,7 +47,6 @@ export function isValidCode(code) {
47
47
  * returned object's data.originalError property.
48
48
  */
49
49
  export function serializeError(error, { fallbackError = FALLBACK_ERROR, shouldIncludeStack = false, } = {}) {
50
- var _a, _b;
51
50
  if (!fallbackError ||
52
51
  !Number.isInteger(fallbackError.code) ||
53
52
  typeof fallbackError.message !== 'string') {
@@ -77,13 +76,13 @@ export function serializeError(error, { fallbackError = FALLBACK_ERROR, shouldIn
77
76
  }
78
77
  else {
79
78
  serialized.code = fallbackError.code;
80
- const message = (_a = error) === null || _a === void 0 ? void 0 : _a.message;
79
+ const message = error === null || error === void 0 ? void 0 : error.message;
81
80
  serialized.message = (message && typeof message === 'string'
82
81
  ? message
83
82
  : fallbackError.message);
84
83
  serialized.data = { originalError: assignOriginalError(error) };
85
84
  }
86
- const stack = (_b = error) === null || _b === void 0 ? void 0 : _b.stack;
85
+ const stack = error === null || error === void 0 ? void 0 : error.stack;
87
86
  if (shouldIncludeStack && error && stack && typeof stack === 'string') {
88
87
  serialized.stack = stack;
89
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/cross-inpage-provider-errors",
3
- "version": "2.0.0-alpha.8",
3
+ "version": "2.0.0",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -28,7 +28,7 @@
28
28
  "start": "tsc --watch"
29
29
  },
30
30
  "dependencies": {
31
- "fast-safe-stringify": "^2.1.1"
31
+ "fast-safe-stringify": "^2.0.6"
32
32
  },
33
- "gitHead": "a72404c2d39b3910aa62c137be02e4643c3b59f0"
33
+ "gitHead": "4e9109e35064cc7dafe3a4f86a33f497ad9567ec"
34
34
  }