Skip to content

Commit 1b41935

Browse files
Merge pull request #35 from dgraph-io/apoorv/rel-v20.07.2
Fix lint errors & bump version for release
2 parents b79ad75 + 65fa9e3 commit 1b41935

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

lib/clientStub.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,15 @@ export class DgraphClientStub {
272272
this.maybeStartRefreshTimer(this.accessToken);
273273
}
274274
setAlphaAuthToken(authToken) {
275-
this.options.headers === undefined && (this.options.headers = {});
275+
if (this.options.headers === undefined) {
276+
this.options.headers = {};
277+
}
276278
this.options.headers[ALPHA_AUTH_TOKEN_HEADER] = authToken;
277279
}
278280
setSlashApiKey(apiKey) {
281+
if (this.options.headers === undefined) {
282+
this.options.headers = {};
283+
}
279284
this.options.headers[SLASH_API_KEY_HEADER] = apiKey;
280285
}
281286
cancelRefreshTimer() {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dgraph-js-http",
3-
"version": "21.03.0-rc1",
3+
"version": "20.07.2",
44
"description": "A javascript HTTP client for Dgraph",
55
"license": "Apache-2.0",
66
"repository": {

src/clientStub.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,16 @@ export class DgraphClientStub {
372372
}
373373

374374
public setAlphaAuthToken(authToken: string) {
375-
this.options.headers === undefined && (this.options.headers = {});
375+
if (this.options.headers === undefined) {
376+
this.options.headers = {};
377+
}
376378
this.options.headers[ALPHA_AUTH_TOKEN_HEADER] = authToken;
377379
}
378380

379381
public setSlashApiKey(apiKey: string) {
380-
this.options.headers === undefined && (this.options.headers = {});
382+
if (this.options.headers === undefined) {
383+
this.options.headers = {};
384+
}
381385
this.options.headers[SLASH_API_KEY_HEADER] = apiKey;
382386
}
383387

0 commit comments

Comments
 (0)