mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
autofix no-var
This commit is contained in:
parent
31e5d785fe
commit
b33f73ac9a
61 changed files with 699 additions and 698 deletions
|
@ -100,7 +100,7 @@ const StrUtils = {
|
|||
* @returns {html}
|
||||
*/
|
||||
runRegex: function(input, args) {
|
||||
var userRegex = args[1],
|
||||
let userRegex = args[1],
|
||||
i = args[2],
|
||||
m = args[3],
|
||||
displayTotal = args[4],
|
||||
|
@ -112,7 +112,7 @@ const StrUtils = {
|
|||
|
||||
if (userRegex && userRegex !== "^" && userRegex !== "$") {
|
||||
try {
|
||||
var regex = new RegExp(userRegex, modifiers);
|
||||
const regex = new RegExp(userRegex, modifiers);
|
||||
|
||||
switch (outputFormat) {
|
||||
case "Highlight matches":
|
||||
|
@ -149,7 +149,7 @@ const StrUtils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
runUpper: function (input, args) {
|
||||
var scope = args[0];
|
||||
const scope = args[0];
|
||||
|
||||
switch (scope) {
|
||||
case "Word":
|
||||
|
@ -213,7 +213,7 @@ const StrUtils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
runFindReplace: function(input, args) {
|
||||
var find = args[0].string,
|
||||
let find = args[0].string,
|
||||
type = args[0].option,
|
||||
replace = args[1],
|
||||
g = args[2],
|
||||
|
@ -257,7 +257,7 @@ const StrUtils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
runSplit: function(input, args) {
|
||||
var splitDelim = args[0] || StrUtils.SPLIT_DELIM,
|
||||
let splitDelim = args[0] || StrUtils.SPLIT_DELIM,
|
||||
joinDelim = Utils.charRep[args[1]],
|
||||
sections = input.split(splitDelim);
|
||||
|
||||
|
@ -274,7 +274,7 @@ const StrUtils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
runFilter: function(input, args) {
|
||||
var delim = Utils.charRep[args[0]],
|
||||
let delim = Utils.charRep[args[0]],
|
||||
reverse = args[2];
|
||||
|
||||
try {
|
||||
|
@ -283,7 +283,7 @@ const StrUtils = {
|
|||
return "Invalid regex. Details: " + err.message;
|
||||
}
|
||||
|
||||
var regexFilter = function(value) {
|
||||
const regexFilter = function(value) {
|
||||
return reverse ^ regex.test(value);
|
||||
};
|
||||
|
||||
|
@ -310,7 +310,7 @@ const StrUtils = {
|
|||
* @returns {html}
|
||||
*/
|
||||
runDiff: function(input, args) {
|
||||
var sampleDelim = args[0],
|
||||
let sampleDelim = args[0],
|
||||
diffBy = args[1],
|
||||
showAdded = args[2],
|
||||
showRemoved = args[3],
|
||||
|
@ -354,7 +354,7 @@ const StrUtils = {
|
|||
return "Invalid 'Diff by' option.";
|
||||
}
|
||||
|
||||
for (var i = 0; i < diff.length; i++) {
|
||||
for (let i = 0; i < diff.length; i++) {
|
||||
if (diff[i].added) {
|
||||
if (showAdded) output += "<span class='hlgreen'>" + Utils.escapeHtml(diff[i].value) + "</span>";
|
||||
} else if (diff[i].removed) {
|
||||
|
@ -382,7 +382,7 @@ const StrUtils = {
|
|||
* @returns {html}
|
||||
*/
|
||||
runOffsetChecker: function(input, args) {
|
||||
var sampleDelim = args[0],
|
||||
let sampleDelim = args[0],
|
||||
samples = input.split(sampleDelim),
|
||||
outputs = [],
|
||||
i = 0,
|
||||
|
@ -526,7 +526,7 @@ const StrUtils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
_regexHighlight: function(input, regex, displayTotal) {
|
||||
var output = "",
|
||||
let output = "",
|
||||
m,
|
||||
hl = 1,
|
||||
i = 0,
|
||||
|
@ -568,7 +568,7 @@ const StrUtils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
_regexList: function(input, regex, displayTotal, matches, captureGroups) {
|
||||
var output = "",
|
||||
let output = "",
|
||||
total = 0,
|
||||
match;
|
||||
|
||||
|
@ -578,7 +578,7 @@ const StrUtils = {
|
|||
output += match[0] + "\n";
|
||||
}
|
||||
if (captureGroups) {
|
||||
for (var i = 1; i < match.length; i++) {
|
||||
for (let i = 1; i < match.length; i++) {
|
||||
if (matches) {
|
||||
output += " Group " + i + ": ";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue