Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Commit caac099

Browse files
author
Paul Korzhyk
committed
Remove warnings
1 parent 461f0f5 commit caac099

File tree

2 files changed

+295
-310
lines changed

2 files changed

+295
-310
lines changed

src/clientStub.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ export class DgraphClientStub {
9191
}
9292

9393
public query(req: Request): Promise<Response> {
94-
const headers = Object.assign(
95-
{},
96-
this.options.headers !== undefined ? this.options.headers : {},
97-
);
94+
const headers =
95+
this.options.headers !== undefined
96+
? { ...this.options.headers }
97+
: {};
9898
if (req.vars !== undefined) {
9999
if (this.legacyApi) {
100100
headers["X-Dgraph-Vars"] = JSON.stringify(req.vars);
@@ -227,13 +227,10 @@ export class DgraphClientStub {
227227
return Promise.reject("Mutation has no data");
228228
}
229229

230-
const headers = Object.assign(
231-
{},
232-
this.options.headers !== undefined ? this.options.headers : {},
233-
{
234-
"Content-Type": `application/${usingJSON ? "json" : "rdf"}`,
235-
},
236-
);
230+
const headers = {
231+
...(this.options.headers !== undefined ? this.options.headers : {}),
232+
"Content-Type": `application/${usingJSON ? "json" : "rdf"}`,
233+
};
237234

238235
if (usingJSON && this.legacyApi) {
239236
headers["X-Dgraph-MutationType"] = "json";

0 commit comments

Comments
 (0)