fix linting

This commit is contained in:
TheSavageTeddy 2022-11-27 12:51:00 +08:00
parent bd51fc05e3
commit fa51addfd5

View file

@ -67,7 +67,7 @@ class URLEncode extends Operation {
encodeAllSpecialChars (str) {
const specialChars = "!#'()*-._~";
let encoded = "";
for (var char of str) {
for (let char of str) {
if (encodeURIComponent(char) === char && specialChars.includes(char)) {
encoded += "%" + this.frontPad(char.charCodeAt(0).toString(16).toUpperCase(), 2, "0");
} else {
@ -85,8 +85,8 @@ class URLEncode extends Operation {
*/
encodeAllChars (str) {
let encoded = "";
for (var char of str) {
encoded += "%" + this.frontPad(char.charCodeAt(0).toString(16).toUpperCase(), 2, "0")
for (let char of str) {
encoded += "%" + this.frontPad(char.charCodeAt(0).toString(16).toUpperCase(), 2, "0");
}
return encoded;
}