mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 16:26:16 -04:00
autofix no-var
This commit is contained in:
parent
31e5d785fe
commit
b33f73ac9a
61 changed files with 699 additions and 698 deletions
|
@ -36,7 +36,7 @@ const SeqUtils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
runSort: function (input, args) {
|
||||
var delim = Utils.charRep[args[0]],
|
||||
let delim = Utils.charRep[args[0]],
|
||||
sortReverse = args[1],
|
||||
order = args[2],
|
||||
sorted = input.split(delim);
|
||||
|
@ -62,7 +62,7 @@ const SeqUtils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
runUnique: function (input, args) {
|
||||
var delim = Utils.charRep[args[0]];
|
||||
const delim = Utils.charRep[args[0]];
|
||||
return input.split(delim).unique().join(delim);
|
||||
},
|
||||
|
||||
|
@ -81,12 +81,12 @@ const SeqUtils = {
|
|||
* @returns {number}
|
||||
*/
|
||||
runCount: function(input, args) {
|
||||
var search = args[0].string,
|
||||
let search = args[0].string,
|
||||
type = args[0].option;
|
||||
|
||||
if (type === "Regex" && search) {
|
||||
try {
|
||||
var regex = new RegExp(search, "gi"),
|
||||
let regex = new RegExp(search, "gi"),
|
||||
matches = input.match(regex);
|
||||
return matches.length;
|
||||
} catch (err) {
|
||||
|
@ -118,7 +118,7 @@ const SeqUtils = {
|
|||
*/
|
||||
runReverse: function (input, args) {
|
||||
if (args[0] === "Line") {
|
||||
var lines = [],
|
||||
let lines = [],
|
||||
line = [],
|
||||
result = [];
|
||||
for (var i = 0; i < input.length; i++) {
|
||||
|
@ -150,11 +150,11 @@ const SeqUtils = {
|
|||
* @returns {string}
|
||||
*/
|
||||
runAddLineNumbers: function(input, args) {
|
||||
var lines = input.split("\n"),
|
||||
let lines = input.split("\n"),
|
||||
output = "",
|
||||
width = lines.length.toString().length;
|
||||
|
||||
for (var n = 0; n < lines.length; n++) {
|
||||
for (let n = 0; n < lines.length; n++) {
|
||||
output += Utils.pad((n+1).toString(), width, " ") + " " + lines[n] + "\n";
|
||||
}
|
||||
return output.slice(0, output.length-1);
|
||||
|
@ -207,7 +207,7 @@ const SeqUtils = {
|
|||
* @returns {number}
|
||||
*/
|
||||
_ipSort: function(a, b) {
|
||||
var a_ = a.split("."),
|
||||
let a_ = a.split("."),
|
||||
b_ = b.split(".");
|
||||
|
||||
a_ = a_[0] * 0x1000000 + a_[1] * 0x10000 + a_[2] * 0x100 + a_[3] * 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue