Socket
Socket
Sign inDemoInstall

@gnosis.pm/safe-react-gateway-sdk

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gnosis.pm/safe-react-gateway-sdk - npm Package Compare versions

Comparing version 3.5.1 to 3.5.2

23

dist/utils.js

@@ -17,2 +17,6 @@ "use strict";

const cross_fetch_1 = __importDefault(require("cross-fetch"));
const isErrorResponse = (data) => {
const isObject = typeof data === 'object' && data !== null;
return isObject && 'code' in data && 'message' in data;
};
function replaceParam(str, key, value) {

@@ -54,12 +58,13 @@ return str.replace(new RegExp(`\\{${key}\\}`, 'g'), value);

const resp = yield (0, cross_fetch_1.default)(url, options);
const json = yield resp.json();
let json;
try {
json = yield resp.json();
}
catch (_a) {
if (resp.headers && resp.headers.get('content-length') !== '0') {
throw new Error(`Invalid response content: ${resp.statusText}`);
}
}
if (!resp.ok) {
let errTxt = '';
try {
const err = json;
errTxt = `${err.code}: ${err.message}`;
}
catch (e) {
errTxt = resp.statusText;
}
const errTxt = isErrorResponse(json) ? `${json.code}: ${json.message}` : resp.statusText;
throw new Error(errTxt);

@@ -66,0 +71,0 @@ }

{
"name": "@gnosis.pm/safe-react-gateway-sdk",
"version": "3.5.1",
"version": "3.5.2",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

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