Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cardano-sdk/util

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cardano-sdk/util - npm Package Compare versions

Comparing version 0.12.0 to 0.12.1

1

dist/cjs/network.d.ts

@@ -1,3 +0,2 @@

export declare const connectionErrorCodes: string[];
export declare const isConnectionError: (error: any) => boolean;
//# sourceMappingURL=network.d.ts.map

17

dist/cjs/network.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isConnectionError = exports.connectionErrorCodes = void 0;
exports.connectionErrorCodes = [
exports.isConnectionError = void 0;
const connectionErrorCodes = new Set([
'ETIMEDOUT',

@@ -11,13 +11,14 @@ 'ECONNRESET',

'ENETUNREACH',
'EAI_AGAIN',
'WebSocket is closed'
];
'EAI_AGAIN'
]);
const connectionErrorNames = new Set(['WebSocketClosed', 'ServerNotReady']);
const isConnectionError = (error) => {
if ((error?.code && exports.connectionErrorCodes.includes(error.code)) ||
(error?.message && exports.connectionErrorCodes.some((err) => error.message.includes(err)))) {
if (!error || typeof error !== 'object')
return false;
if ((error?.name && connectionErrorNames.has(error.name)) || (error?.code && connectionErrorCodes.has(error.code))) {
return true;
}
return false;
return (0, exports.isConnectionError)(error.innerError);
};
exports.isConnectionError = isConnectionError;
//# sourceMappingURL=network.js.map

@@ -1,3 +0,2 @@

export declare const connectionErrorCodes: string[];
export declare const isConnectionError: (error: any) => boolean;
//# sourceMappingURL=network.d.ts.map

@@ -1,2 +0,2 @@

export const connectionErrorCodes = [
const connectionErrorCodes = new Set([
'ETIMEDOUT',

@@ -8,12 +8,13 @@ 'ECONNRESET',

'ENETUNREACH',
'EAI_AGAIN',
'WebSocket is closed'
];
'EAI_AGAIN'
]);
const connectionErrorNames = new Set(['WebSocketClosed', 'ServerNotReady']);
export const isConnectionError = (error) => {
if ((error?.code && connectionErrorCodes.includes(error.code)) ||
(error?.message && connectionErrorCodes.some((err) => error.message.includes(err)))) {
if (!error || typeof error !== 'object')
return false;
if ((error?.name && connectionErrorNames.has(error.name)) || (error?.code && connectionErrorCodes.has(error.code))) {
return true;
}
return false;
return isConnectionError(error.innerError);
};
//# sourceMappingURL=network.js.map
{
"name": "@cardano-sdk/util",
"version": "0.12.0",
"version": "0.12.1",
"description": "General, not cardano-specific utils",

@@ -65,3 +65,3 @@ "engines": {

],
"gitHead": "46029ae65c25ce6cfef394249c7ff5a32259757f"
"gitHead": "13adbccfb323611b1972ccc7a5498a033ea5fcc5"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc