Socket
Socket
Sign inDemoInstall

@chainsafe/lodestar-api

Package Overview
Dependencies
128
Maintainers
3
Versions
819
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.39.0-dev.9feb5bd47c to 0.39.0-dev.a21514a7d9

8

lib/utils/client/client.js

@@ -39,7 +39,13 @@ import { mapValues } from "@chainsafe/lodestar-utils";

return async function request(...args) {
const res = await fetchFn.json(fetchOptsSerializer(...args));
if (returnType) {
const res = await fetchFn.json(fetchOptsSerializer(...args));
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return returnType.fromJson(res);
}
else {
// We need to avoid parsing the response as the servers might just
// response status 200 and close the request instead of writing an
// empty json response
await fetchFn.request(fetchOptsSerializer(...args));
}
};

@@ -46,0 +52,0 @@ });

4

lib/utils/client/httpClient.d.ts

@@ -22,2 +22,3 @@ import { fetch } from "cross-fetch";

json<T>(opts: FetchOpts): Promise<T>;
request(opts: FetchOpts): Promise<void>;
arrayBuffer(opts: FetchOpts): Promise<ArrayBuffer>;

@@ -49,5 +50,6 @@ }

json<T>(opts: FetchOpts): Promise<T>;
request(opts: FetchOpts): Promise<void>;
arrayBuffer(opts: FetchOpts): Promise<ArrayBuffer>;
private request;
private requestWithBody;
}
//# sourceMappingURL=httpClient.d.ts.map

@@ -26,8 +26,11 @@ import { fetch } from "cross-fetch";

async json(opts) {
return await this.request(opts, (res) => res.json());
return await this.requestWithBody(opts, (res) => res.json());
}
async request(opts) {
return await this.requestWithBody(opts, async (_res) => void 0);
}
async arrayBuffer(opts) {
return await this.request(opts, (res) => res.arrayBuffer());
return await this.requestWithBody(opts, (res) => res.arrayBuffer());
}
async request(opts, getBody) {
async requestWithBody(opts, getBody) {
var _a, _b, _c, _d, _e;

@@ -34,0 +37,0 @@ // Implement fetch timeout

@@ -14,3 +14,3 @@ {

},
"version": "0.39.0-dev.9feb5bd47c",
"version": "0.39.0-dev.a21514a7d9",
"type": "module",

@@ -73,6 +73,6 @@ "exports": {

"dependencies": {
"@chainsafe/lodestar-config": "0.39.0-dev.9feb5bd47c",
"@chainsafe/lodestar-params": "0.39.0-dev.9feb5bd47c",
"@chainsafe/lodestar-types": "0.39.0-dev.9feb5bd47c",
"@chainsafe/lodestar-utils": "0.39.0-dev.9feb5bd47c",
"@chainsafe/lodestar-config": "0.39.0-dev.a21514a7d9",
"@chainsafe/lodestar-params": "0.39.0-dev.a21514a7d9",
"@chainsafe/lodestar-types": "0.39.0-dev.a21514a7d9",
"@chainsafe/lodestar-utils": "0.39.0-dev.a21514a7d9",
"@chainsafe/persistent-merkle-tree": "^0.4.2",

@@ -82,3 +82,2 @@ "@chainsafe/ssz": "^0.9.2",

"eventsource": "^2.0.2",
"fastify": "3.15.1",
"qs": "^6.10.1"

@@ -88,3 +87,4 @@ },

"@types/eventsource": "^1.1.5",
"@types/qs": "^6.9.6"
"@types/qs": "^6.9.6",
"fastify": "3.15.1"
},

@@ -101,3 +101,3 @@ "peerDependencies": {

],
"gitHead": "144e3be72dd59a5d7d3379129275b2bb839cf133"
"gitHead": "ec4ba784500bffb59d54a5e499b40b21b7395ddf"
}

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc