Fix linting issues

This commit is contained in:
2024-02-22 00:55:46 -05:00
parent 4631ee1450
commit dcb29f0564
7 changed files with 25 additions and 20 deletions
+6 -6
View File
@@ -16,12 +16,12 @@ const redirectCodes = new Set([301, 302, 307, 308]);
*/
/**
* @param {string} url
* @param {FetchOptions} options
* @param {string} requestedUrl
* @param {FetchOptions} fetchOptions
*/
export function nativeFetch(url, options) {
export function nativeFetch(requestedUrl, fetchOptions) {
let state = "PENDING";
const data = {content: [], headers: null, statusCode: null, url: url, statusText: "", redirected: false};
const data = {content: [], headers: null, statusCode: null, url: requestedUrl, statusText: "", redirected: false};
const listeners = new Set();
const errors = new Set();
@@ -121,11 +121,11 @@ export function nativeFetch(url, options) {
* reference to the object below so they have no way of
* listening to the error through onError.
*/
const parsed = new URL(url);
const parsed = new URL(requestedUrl);
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
throw new Error(`Unsupported protocol: ${parsed.protocol}`);
}
execute(parsed, options);
execute(parsed, fetchOptions);
return {
onComplete(listener) {
+2 -1
View File
@@ -39,7 +39,8 @@ const makeRequest = (url, options, callback, setReq) => {
// Make sure to close the socket.
try {req.write(options.formData);}
finally {req.end();}
} else {
}
else {
req.end();
}