@onekeyfe/cross-inpage-provider-errors
Advanced tools
Comparing version 2.0.0-alpha.10 to 2.0.0-alpha.11
@@ -55,3 +55,2 @@ "use strict"; | ||
function serializeError(error, { fallbackError = FALLBACK_ERROR, shouldIncludeStack = false, } = {}) { | ||
var _a, _b; | ||
if (!fallbackError || | ||
@@ -86,3 +85,3 @@ !Number.isInteger(fallbackError.code) || | ||
serialized.code = fallbackError.code; | ||
const message = (_a = error) === null || _a === void 0 ? void 0 : _a.message; | ||
const message = error === null || error === void 0 ? void 0 : error.message; | ||
serialized.message = (message && typeof message === 'string' | ||
@@ -93,3 +92,3 @@ ? message | ||
} | ||
const stack = (_b = error) === null || _b === void 0 ? void 0 : _b.stack; | ||
const stack = error === null || error === void 0 ? void 0 : error.stack; | ||
if (shouldIncludeStack && error && stack && typeof stack === 'string') { | ||
@@ -96,0 +95,0 @@ serialized.stack = stack; |
@@ -9,4 +9,4 @@ import { Web3RpcError, Web3ProviderError } from './classes'; | ||
} | ||
declare type CustomErrorArg<T> = ServerErrorOptions<T>; | ||
declare type Web3ErrorsArg<T> = Web3ErrorOptions<T> | string; | ||
type CustomErrorArg<T> = ServerErrorOptions<T>; | ||
type Web3ErrorsArg<T> = Web3ErrorOptions<T> | string; | ||
export declare const web3Errors: { | ||
@@ -13,0 +13,0 @@ rpc: { |
@@ -50,3 +50,2 @@ import { errorCodes, errorValues } from './error-constants'; | ||
export function serializeError(error, { fallbackError = FALLBACK_ERROR, shouldIncludeStack = false, } = {}) { | ||
var _a, _b; | ||
if (!fallbackError || | ||
@@ -81,3 +80,3 @@ !Number.isInteger(fallbackError.code) || | ||
serialized.code = fallbackError.code; | ||
const message = (_a = error) === null || _a === void 0 ? void 0 : _a.message; | ||
const message = error === null || error === void 0 ? void 0 : error.message; | ||
serialized.message = (message && typeof message === 'string' | ||
@@ -88,3 +87,3 @@ ? message | ||
} | ||
const stack = (_b = error) === null || _b === void 0 ? void 0 : _b.stack; | ||
const stack = error === null || error === void 0 ? void 0 : error.stack; | ||
if (shouldIncludeStack && error && stack && typeof stack === 'string') { | ||
@@ -91,0 +90,0 @@ serialized.stack = stack; |
{ | ||
"name": "@onekeyfe/cross-inpage-provider-errors", | ||
"version": "2.0.0-alpha.10", | ||
"version": "2.0.0-alpha.11", | ||
"keywords": [ | ||
@@ -31,5 +31,5 @@ "cross-inpage-provider" | ||
"dependencies": { | ||
"fast-safe-stringify": "^2.1.1" | ||
"fast-safe-stringify": "^2.0.6" | ||
}, | ||
"gitHead": "f760989b7ea7bfca832ba396544808fb99081007" | ||
"gitHead": "db33d14c2a164072b2f5dd4cf94e18886539ab5b" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43262
1377
19
1117
Updatedfast-safe-stringify@^2.0.6