This repository was archived by the owner on Sep 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff 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 ( ) {
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments