feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -36,7 +36,7 @@ function getScheme(specifier) {
(start < aLowerCaseCharCode || start > zLowerCaseCharCode) &&
(start < aUpperCaseCharCode || start > zUpperCaseCharCode)
) {
return undefined;
return;
}
let i = 1;
@@ -49,12 +49,12 @@ function getScheme(specifier) {
ch === plusCharCode ||
ch === hyphenCharCode
) {
if (++i === specifier.length) return undefined;
if (++i === specifier.length) return;
ch = specifier.charCodeAt(i);
}
// Scheme must end with colon
if (ch !== colonCharCode) return undefined;
if (ch !== colonCharCode) return;
// Check for Windows absolute path
// https://url.spec.whatwg.org/#url-miscellaneous
@@ -67,7 +67,7 @@ function getScheme(specifier) {
nextChar === hashCharCode ||
nextChar === queryCharCode
) {
return undefined;
return;
}
}
@@ -80,8 +80,8 @@ function getScheme(specifier) {
*/
function getProtocol(specifier) {
const scheme = getScheme(specifier);
return scheme === undefined ? undefined : scheme + ":";
return scheme === undefined ? undefined : `${scheme}:`;
}
exports.getScheme = getScheme;
exports.getProtocol = getProtocol;
module.exports.getScheme = getScheme;
module.exports.getProtocol = getProtocol;