Skip to content

Commit 4711020

Browse files
committed
Fix build
1 parent ee30e4d commit 4711020

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/util/request.node.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import {
33
ClientRequest,
44
ClientRequestArgs,
55
IncomingMessage,
6-
request as httpRequest
6+
request as httpRequest,
77
} from "http";
88
import { Agent as HttpsAgent, request as httpsRequest } from "https";
9-
import { parse as parseUrl, Url } from "url";
9+
import { parse as parseUrl } from "url";
1010
import { btoa } from "./btoa";
1111
import { joinPath } from "./joinPath";
1212
import { Errback } from "./types";
@@ -23,7 +23,7 @@ export type ArangojsError = Error & {
2323

2424
export interface RequestOptions {
2525
method: string;
26-
url: Url;
26+
url: { pathname: string; search?: string };
2727
headers: { [key: string]: string };
2828
body: any;
2929
expectBinary: boolean;
@@ -57,10 +57,10 @@ export function createRequest(
5757
const i = baseUrlParts.pathname.indexOf(":");
5858
if (i === -1) {
5959
socketPath = baseUrlParts.pathname;
60-
baseUrlParts.pathname = undefined;
60+
baseUrlParts.pathname = null;
6161
} else {
6262
socketPath = baseUrlParts.pathname.slice(0, i);
63-
baseUrlParts.pathname = baseUrlParts.pathname.slice(i + 1) || undefined;
63+
baseUrlParts.pathname = baseUrlParts.pathname.slice(i + 1) || null;
6464
}
6565
}
6666
if (socketPath && !socketPath.replace(/\//g, "").length) {
@@ -107,7 +107,7 @@ export function createRequest(
107107
options,
108108
(res: IncomingMessage) => {
109109
const data: Buffer[] = [];
110-
res.on("data", chunk => data.push(chunk as Buffer));
110+
res.on("data", (chunk) => data.push(chunk as Buffer));
111111
res.on("end", () => {
112112
const result = res as ArangojsResponse;
113113
result.request = req;
@@ -124,7 +124,7 @@ export function createRequest(
124124
req.on("timeout", () => {
125125
req.abort();
126126
});
127-
req.on("error", err => {
127+
req.on("error", (err) => {
128128
const error = err as ArangojsError;
129129
error.request = req;
130130
if (called) return;
@@ -138,13 +138,13 @@ export function createRequest(
138138
called = true;
139139
setTimeout(() => {
140140
callback(e);
141-
});
141+
}, 0);
142142
}
143143
},
144144
{
145145
close() {
146146
agent.destroy();
147-
}
147+
},
148148
}
149149
);
150150
}

0 commit comments

Comments
 (0)