From fa51addfd5abe8be3887723e770c000e60bdf315 Mon Sep 17 00:00:00 2001 From: TheSavageTeddy <51810476+TheSavageTeddy@users.noreply.github.com> Date: Sun, 27 Nov 2022 12:51:00 +0800 Subject: [PATCH] fix linting --- src/core/operations/URLEncode.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/operations/URLEncode.mjs b/src/core/operations/URLEncode.mjs index f326d85f..61a18d75 100644 --- a/src/core/operations/URLEncode.mjs +++ b/src/core/operations/URLEncode.mjs @@ -54,7 +54,7 @@ class URLEncode extends Operation { * @param {string} str * @returns {string} */ - frontPad (str, length, char){ + frontPad (str, length, char) { return str.length >= length ? str : (char * (length - str.length)) + str; } @@ -67,8 +67,8 @@ class URLEncode extends Operation { encodeAllSpecialChars (str) { const specialChars = "!#'()*-._~"; let encoded = ""; - for (var char of str) { - if (encodeURIComponent(char) === char && specialChars.includes(char)){ + for (let char of str) { + if (encodeURIComponent(char) === char && specialChars.includes(char)) { encoded += "%" + this.frontPad(char.charCodeAt(0).toString(16).toUpperCase(), 2, "0"); } else { encoded += encodeURIComponent(char); @@ -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; }