export const setSocketTimeout = (request, reject, timeoutInMs = 0) => { request.setTimeout(timeoutInMs, () => { request.destroy(); reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); }); };