autofix no-var

This commit is contained in:
Thomas Grainger 2017-04-13 18:08:50 +01:00
parent 31e5d785fe
commit b33f73ac9a
No known key found for this signature in database
GPG key ID: 995EA0A029283160
61 changed files with 699 additions and 698 deletions

View file

@ -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;