2
0
mirror of https://github.com/gchq/CyberChef synced 2025-12-30 15:13:36 +00:00

auto-fix prefer-const

This commit is contained in:
Thomas Grainger
2017-05-02 23:06:28 +01:00
parent 5b03a84be8
commit 15aea9e9ea
5 changed files with 14 additions and 14 deletions

View File

@@ -426,7 +426,7 @@ const Code = {
* @returns {string}
*/
_replaceVariableNames(input, replacer) {
let tokenRegex = /\\"|"(?:\\"|[^"])*"|(\b[a-z0-9\-_]+\b)/ig;
const tokenRegex = /\\"|"(?:\\"|[^"])*"|(\b[a-z0-9\-_]+\b)/ig;
return input.replace(tokenRegex, (...args) => {
let match = args[0],
@@ -450,7 +450,7 @@ const Code = {
*
*/
runToSnakeCase(input, args) {
let smart = args[0];
const smart = args[0];
if (smart) {
return Code._replaceVariableNames(input, snakeCase);
@@ -469,7 +469,7 @@ const Code = {
*
*/
runToCamelCase(input, args) {
let smart = args[0];
const smart = args[0];
if (smart) {
return Code._replaceVariableNames(input, camelCase);
@@ -488,7 +488,7 @@ const Code = {
*
*/
runToKebabCase(input, args) {
let smart = args[0];
const smart = args[0];
if (smart) {
return Code._replaceVariableNames(input, kebabCase);

View File

@@ -471,7 +471,7 @@ const StrUtils = {
number = args[1];
delimiter = Utils.charRep[delimiter];
let splitInput = input.split(delimiter);
const splitInput = input.split(delimiter);
return splitInput
.filter((line, lineIndex) => {
@@ -499,7 +499,7 @@ const StrUtils = {
number = args[1];
delimiter = Utils.charRep[delimiter];
let splitInput = input.split(delimiter);
const splitInput = input.split(delimiter);
return splitInput
.filter((line, lineIndex) => {