mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 23:36:16 -04:00
Merge branch 'prefer-const' of https://github.com/graingert/CyberChef into graingert-prefer-const
This commit is contained in:
commit
5efe9bd91d
15 changed files with 165 additions and 163 deletions
|
@ -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);
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue