mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
autofix no-var
This commit is contained in:
parent
31e5d785fe
commit
b33f73ac9a
61 changed files with 699 additions and 698 deletions
|
@ -28,7 +28,7 @@ const URL_ = {
|
|||
* @returns {string}
|
||||
*/
|
||||
runTo: function(input, args) {
|
||||
var encodeAll = args[0];
|
||||
const encodeAll = args[0];
|
||||
return encodeAll ? URL_._encodeAllChars(input) : encodeURI(input);
|
||||
},
|
||||
|
||||
|
@ -41,7 +41,7 @@ const URL_ = {
|
|||
* @returns {string}
|
||||
*/
|
||||
runFrom: function(input, args) {
|
||||
var data = input.replace(/\+/g, "%20");
|
||||
const data = input.replace(/\+/g, "%20");
|
||||
try {
|
||||
return decodeURIComponent(data);
|
||||
} catch (err) {
|
||||
|
@ -62,14 +62,14 @@ const URL_ = {
|
|||
throw "This operation only works in a browser.";
|
||||
}
|
||||
|
||||
var a = document.createElement("a");
|
||||
const a = document.createElement("a");
|
||||
|
||||
// Overwrite base href which will be the current CyberChef URL to reduce confusion.
|
||||
a.href = "http://example.com/";
|
||||
a.href = input;
|
||||
|
||||
if (a.protocol) {
|
||||
var output = "";
|
||||
let output = "";
|
||||
if (a.hostname !== window.location.hostname) {
|
||||
output = "Protocol:\t" + a.protocol + "\n";
|
||||
if (a.hostname) output += "Hostname:\t" + a.hostname + "\n";
|
||||
|
@ -77,7 +77,7 @@ const URL_ = {
|
|||
}
|
||||
|
||||
if (a.pathname && a.pathname !== window.location.pathname) {
|
||||
var pathname = a.pathname;
|
||||
let pathname = a.pathname;
|
||||
if (pathname.indexOf(window.location.pathname) === 0)
|
||||
pathname = pathname.replace(window.location.pathname, "");
|
||||
if (pathname)
|
||||
|
@ -90,8 +90,8 @@ const URL_ = {
|
|||
|
||||
if (a.search && a.search !== window.location.search) {
|
||||
output += "Arguments:\n";
|
||||
var args_ = (a.search.slice(1, a.search.length)).split("&");
|
||||
var splitArgs = [], padding = 0;
|
||||
const args_ = (a.search.slice(1, a.search.length)).split("&");
|
||||
let splitArgs = [], padding = 0;
|
||||
for (var i = 0; i < args_.length; i++) {
|
||||
splitArgs.push(args_[i].split("="));
|
||||
padding = (splitArgs[i][0].length > padding) ? splitArgs[i][0].length : padding;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue