mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Updated eslint whitespace rules
This commit is contained in:
parent
ebf2258715
commit
e803d208e8
51 changed files with 801 additions and 793 deletions
|
@ -17,7 +17,7 @@ var URL_ = {
|
|||
* @default
|
||||
*/
|
||||
ENCODE_ALL: false,
|
||||
|
||||
|
||||
/**
|
||||
* URL Encode operation.
|
||||
*
|
||||
|
@ -29,8 +29,8 @@ var URL_ = {
|
|||
var encodeAll = args[0];
|
||||
return encodeAll ? URL_._encodeAllChars(input) : encodeURI(input);
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* URL Decode operation.
|
||||
*
|
||||
|
@ -42,12 +42,12 @@ var URL_ = {
|
|||
var data = input.replace(/\+/g, "%20");
|
||||
try {
|
||||
return decodeURIComponent(data);
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
return unescape(data);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Parse URI operation.
|
||||
*
|
||||
|
@ -57,11 +57,11 @@ var URL_ = {
|
|||
*/
|
||||
runParse: function(input, args) {
|
||||
var 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 = "";
|
||||
if (a.hostname !== window.location.hostname) {
|
||||
|
@ -69,7 +69,7 @@ var URL_ = {
|
|||
if (a.hostname) output += "Hostname:\t" + a.hostname + "\n";
|
||||
if (a.port) output += "Port:\t\t" + a.port + "\n";
|
||||
}
|
||||
|
||||
|
||||
if (a.pathname && a.pathname !== window.location.pathname) {
|
||||
var pathname = a.pathname;
|
||||
if (pathname.indexOf(window.location.pathname) === 0)
|
||||
|
@ -77,11 +77,11 @@ var URL_ = {
|
|||
if (pathname)
|
||||
output += "Path name:\t" + pathname + "\n";
|
||||
}
|
||||
|
||||
|
||||
if (a.hash && a.hash !== window.location.hash) {
|
||||
output += "Hash:\t\t" + a.hash + "\n";
|
||||
}
|
||||
|
||||
|
||||
if (a.search && a.search !== window.location.search) {
|
||||
output += "Arguments:\n";
|
||||
var args_ = (a.search.slice(1, a.search.length)).split("&");
|
||||
|
@ -97,14 +97,14 @@ var URL_ = {
|
|||
else output += "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
return "Invalid URI";
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* URL encodes additional special characters beyond the standard set.
|
||||
*
|
||||
|
@ -126,5 +126,5 @@ var URL_ = {
|
|||
.replace(/_/g, "%5F")
|
||||
.replace(/~/g, "%7E");
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue