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

Commit eb7927c

Browse files
committed
Updated binary
1 parent c27b999 commit eb7927c

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

lib/clientStub.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
var __assign = (this && this.__assign) || function () {
3-
__assign = Object.assign || function (t) {
3+
__assign = Object.assign || function(t) {
44
for (var s, i = 1, n = arguments.length; i < n; i++) {
55
s = arguments[i];
66
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
2020
});
2121
};
2222
var __generator = (this && this.__generator) || function (thisArg, body) {
23-
var _ = { label: 0, sent: function () { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
23+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
2525
function verb(n) { return function (v) { return step([n, v]); }; }
2626
function step(op) {
2727
if (f) throw new TypeError("Generator is already executing.");
@@ -71,7 +71,7 @@ var DgraphClientStub = (function () {
7171
stubConfig.jsonParser !== undefined
7272
? stubConfig.jsonParser
7373
:
74-
JSON.parse.bind(JSON);
74+
JSON.parse.bind(JSON);
7575
}
7676
DgraphClientStub.prototype.detectApiVersion = function () {
7777
return __awaiter(this, void 0, void 0, function () {
@@ -170,9 +170,9 @@ var DgraphClientStub = (function () {
170170
url += "?";
171171
url += params
172172
.map(function (_a) {
173-
var key = _a.key, value = _a.value;
174-
return key + "=" + value;
175-
})
173+
var key = _a.key, value = _a.value;
174+
return key + "=" + value;
175+
})
176176
.join("&");
177177
}
178178
}
@@ -197,8 +197,8 @@ var DgraphClientStub = (function () {
197197
body = "{\n " + (mu.setNquads === undefined
198198
? ""
199199
: "set {\n " + mu.setNquads + "\n }") + "\n " + (mu.deleteNquads === undefined
200-
? ""
201-
: "delete {\n " + mu.deleteNquads + "\n }") + "\n }";
200+
? ""
201+
: "delete {\n " + mu.deleteNquads + "\n }") + "\n }";
202202
}
203203
else if (mu.mutation !== undefined) {
204204
body = mu.mutation;
@@ -237,10 +237,8 @@ var DgraphClientStub = (function () {
237237
headers["X-Dgraph-CommitNow"] = "true";
238238
}
239239
}
240-
return this.callAPI(url, __assign(__assign({}, this.options), {
241-
method: "POST", body: body,
242-
headers: headers
243-
}));
240+
return this.callAPI(url, __assign(__assign({}, this.options), { method: "POST", body: body,
241+
headers: headers }));
244242
};
245243
DgraphClientStub.prototype.commit = function (ctx) {
246244
var body;
@@ -335,6 +333,7 @@ var DgraphClientStub = (function () {
335333
this.maybeStartRefreshTimer(this.accessToken);
336334
};
337335
DgraphClientStub.prototype.setAlphaAuthToken = function (authToken) {
336+
this.options.headers === undefined && (this.options.headers = {});
338337
this.options.headers[ALPHA_AUTH_TOKEN_HEADER] = authToken;
339338
};
340339
DgraphClientStub.prototype.setSlashApiKey = function (apiKey) {

0 commit comments

Comments
 (0)