Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await wait(sleepTime * 1000);
} else if (response.statusCode >= 400 && response.statusCode <= 599) {
throw new StatusCodeError(response.statusCode, response.body, {}, null);
}
return opts.resolveWithFullResponse ? response : response.body;
} as XhrInstancePromisified;
}
const promisifyWithRetryDelete = promisifyWithRetry(XHR.del);
const XMLHttpRequesterPromisifiedExtras = {
del: promisifyWithRetryDelete,
delete: promisifyWithRetryDelete,
get: promisifyWithRetry(XHR.get),
head: promisifyWithRetry(XHR.head),
patch: promisifyWithRetry(XHR.patch),
post: promisifyWithRetry(XHR.post),
put: promisifyWithRetry(XHR.put),
};
const XMLHttpRequester: XhrStaticPromisified = Object.assign(
promisifyWithRetry(XHR),
XMLHttpRequesterPromisifiedExtras,
);
export default XMLHttpRequester;