Socket
Socket
Sign inDemoInstall

@0xproject/connect

Package Overview
Dependencies
47
Maintainers
5
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.0 to 0.6.1

4

CHANGELOG.md
# CHANGELOG
## v0.6.1 - _February 16, 2018_
* Fix JSON parse empty response (#407)
## v0.6.0 - _February 16, 2018_

@@ -4,0 +8,0 @@

11

lib/src/http_client.js

@@ -238,3 +238,3 @@ "use strict";

return __awaiter(this, void 0, void 0, function () {
var params, payload, query, url, headers, response, json, errorString;
var params, payload, query, url, headers, response, text, errorString, result;
return __generator(this, function (_a) {

@@ -257,10 +257,11 @@ switch (_a.label) {

response = _a.sent();
return [4 /*yield*/, response.json()];
return [4 /*yield*/, response.text()];
case 2:
json = _a.sent();
text = _a.sent();
if (!response.ok) {
errorString = response.status + " - " + response.statusText + "\n" + requestType + " " + url + "\n" + JSON.stringify(json);
errorString = response.status + " - " + response.statusText + "\n" + requestType + " " + url + "\n" + text;
throw Error(errorString);
}
return [2 /*return*/, json];
result = !_.isEmpty(text) ? JSON.parse(text) : undefined;
return [2 /*return*/, result];
}

@@ -267,0 +268,0 @@ });

@@ -16,3 +16,3 @@ import { OrderbookChannel, OrderbookChannelHandler, OrderbookChannelSubscriptionOpts, WebSocketOrderbookChannelConfig } from './types';

* @param url The relayer API base WS url you would like to interact with
* @param url The configuration object. Look up the type for the description.
* @param config The configuration object. Look up the type for the description.
* @return An instance of WebSocketOrderbookChannel

@@ -19,0 +19,0 @@ */

@@ -20,3 +20,3 @@ "use strict";

* @param url The relayer API base WS url you would like to interact with
* @param url The configuration object. Look up the type for the description.
* @param config The configuration object. Look up the type for the description.
* @return An instance of WebSocketOrderbookChannel

@@ -23,0 +23,0 @@ */

{
"name": "@0xproject/connect",
"version": "0.6.0",
"version": "0.6.1",
"description": "A javascript library for interacting with the standard relayer api",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc