mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Linting changes
This commit is contained in:
parent
c1878ca28b
commit
33464b3388
19 changed files with 42 additions and 41 deletions
|
@ -758,15 +758,15 @@ class Utils {
|
|||
"%7E": "~",
|
||||
"%21": "!",
|
||||
"%24": "$",
|
||||
//"%26": "&",
|
||||
// "%26": "&",
|
||||
"%27": "'",
|
||||
"%28": "(",
|
||||
"%29": ")",
|
||||
"%2A": "*",
|
||||
//"%2B": "+",
|
||||
// "%2B": "+",
|
||||
"%2C": ",",
|
||||
"%3B": ";",
|
||||
//"%3D": "=",
|
||||
// "%3D": "=",
|
||||
"%3A": ":",
|
||||
"%40": "@",
|
||||
"%2F": "/",
|
||||
|
@ -1335,14 +1335,14 @@ export function debounce(func, wait, id, scope, args) {
|
|||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart
|
||||
if (!String.prototype.padStart) {
|
||||
String.prototype.padStart = function padStart(targetLength, padString) {
|
||||
targetLength = targetLength>>0; //floor if number or convert non-number to 0;
|
||||
targetLength = targetLength>>0; // floor if number or convert non-number to 0;
|
||||
padString = String((typeof padString !== "undefined" ? padString : " "));
|
||||
if (this.length > targetLength) {
|
||||
return String(this);
|
||||
} else {
|
||||
targetLength = targetLength-this.length;
|
||||
if (targetLength > padString.length) {
|
||||
padString += padString.repeat(targetLength/padString.length); //append to original to ensure we are longer than needed
|
||||
padString += padString.repeat(targetLength/padString.length); // append to original to ensure we are longer than needed
|
||||
}
|
||||
return padString.slice(0, targetLength) + String(this);
|
||||
}
|
||||
|
@ -1354,14 +1354,14 @@ if (!String.prototype.padStart) {
|
|||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd
|
||||
if (!String.prototype.padEnd) {
|
||||
String.prototype.padEnd = function padEnd(targetLength, padString) {
|
||||
targetLength = targetLength>>0; //floor if number or convert non-number to 0;
|
||||
targetLength = targetLength>>0; // floor if number or convert non-number to 0;
|
||||
padString = String((typeof padString !== "undefined" ? padString : " "));
|
||||
if (this.length > targetLength) {
|
||||
return String(this);
|
||||
} else {
|
||||
targetLength = targetLength-this.length;
|
||||
if (targetLength > padString.length) {
|
||||
padString += padString.repeat(targetLength/padString.length); //append to original to ensure we are longer than needed
|
||||
padString += padString.repeat(targetLength/padString.length); // append to original to ensure we are longer than needed
|
||||
}
|
||||
return String(this) + padString.slice(0, targetLength);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
import prompt from "prompt";
|
||||
import colors from "colors";
|
||||
|
@ -208,7 +208,7 @@ ${result.highlight ? `
|
|||
export default ${moduleName};
|
||||
`;
|
||||
|
||||
//console.log(template);
|
||||
// console.log(template);
|
||||
|
||||
const filename = path.join(dir, `./${moduleName}.mjs`);
|
||||
if (fs.existsSync(filename)) {
|
||||
|
|
|
@ -59,7 +59,7 @@ class FromMorseCode extends Operation {
|
|||
const letterDelim = Utils.charRep(args[0]);
|
||||
const wordDelim = Utils.charRep(args[1]);
|
||||
|
||||
input = input.replace(/-|‐|−|_|–|—|dash/ig, "<dash>"); //hyphen-minus|hyphen|minus-sign|undersore|en-dash|em-dash
|
||||
input = input.replace(/-|‐|−|_|–|—|dash/ig, "<dash>"); // hyphen-minus|hyphen|minus-sign|undersore|en-dash|em-dash
|
||||
input = input.replace(/\.|·|dot/ig, "<dot>");
|
||||
|
||||
let words = input.split(wordDelim);
|
||||
|
|
|
@ -117,7 +117,7 @@ class GroupIPAddresses extends Operation {
|
|||
|
||||
// Sort IPv6 network dictionaries and print
|
||||
for (networkStr in ipv6Networks) {
|
||||
//ipv6Networks[networkStr] = ipv6Networks[networkStr].sort(); TODO
|
||||
// ipv6Networks[networkStr] = ipv6Networks[networkStr].sort(); TODO
|
||||
|
||||
output += networkStr + "/" + cidr + "\n";
|
||||
|
||||
|
|
|
@ -391,7 +391,7 @@ class Lorenz extends Operation {
|
|||
// Chi 2 one back lim - The active character of Chi 2 (2nd Chi wheel) in the previous position
|
||||
lim = parseInt(chiSettings[2][x2bptr-1], 10);
|
||||
if (kt) {
|
||||
//p5 back 2
|
||||
// p5 back 2
|
||||
if (lim===p5[2]) {
|
||||
lim = 0;
|
||||
} else {
|
||||
|
@ -413,7 +413,7 @@ class Lorenz extends Operation {
|
|||
lim = 1;
|
||||
if (x2b1lug===s1b1lug) lim=0;
|
||||
if (kt) {
|
||||
//p5 back 2
|
||||
// p5 back 2
|
||||
if (lim===p5[2]) {
|
||||
lim=0;
|
||||
} else {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
import NodeDish from "./NodeDish.mjs";
|
||||
import NodeRecipe from "./NodeRecipe.mjs";
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-global-assign: ["off"] */
|
||||
/* eslint no-global-assign: ["off"] */
|
||||
require = require("esm")(module);
|
||||
module.exports = require("./index.mjs");
|
||||
module.exports.File = require("./File.mjs");
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: 0 */
|
||||
/* eslint no-console: 0 */
|
||||
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
|
|
@ -11,7 +11,7 @@ const chef = require("./cjs.js");
|
|||
const repl = require("repl");
|
||||
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
/* eslint no-console: ["off"] */
|
||||
|
||||
console.log(`
|
||||
______ __ ________ ____
|
||||
|
|
|
@ -604,7 +604,7 @@ class App {
|
|||
else if (prev[1] > 0) prev[1]--;
|
||||
else prev[0]--;
|
||||
|
||||
//const compareURL = `https://github.com/gchq/CyberChef/compare/v${prev.join(".")}...v${PKG_VERSION}`;
|
||||
// const compareURL = `https://github.com/gchq/CyberChef/compare/v${prev.join(".")}...v${PKG_VERSION}`;
|
||||
|
||||
let compileInfo = `<a href='https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md'>Last build: ${timeSinceCompile.substr(0, 1).toUpperCase() + timeSinceCompile.substr(1)} ago</a>`;
|
||||
|
||||
|
|
|
@ -446,7 +446,7 @@ class HighlighterWaiter {
|
|||
}
|
||||
|
||||
const cssClass = "hl1";
|
||||
//if (colour) cssClass += "-"+colour;
|
||||
// if (colour) cssClass += "-"+colour;
|
||||
|
||||
// Remove HTML tags
|
||||
text = text
|
||||
|
|
|
@ -29,20 +29,20 @@ class InputWaiter {
|
|||
|
||||
// Define keys that don't change the input so we don't have to autobake when they are pressed
|
||||
this.badKeys = [
|
||||
16, //Shift
|
||||
17, //Ctrl
|
||||
18, //Alt
|
||||
19, //Pause
|
||||
20, //Caps
|
||||
27, //Esc
|
||||
33, 34, 35, 36, //PgUp, PgDn, End, Home
|
||||
37, 38, 39, 40, //Directional
|
||||
44, //PrntScrn
|
||||
91, 92, //Win
|
||||
93, //Context
|
||||
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, //F1-12
|
||||
144, //Num
|
||||
145, //Scroll
|
||||
16, // Shift
|
||||
17, // Ctrl
|
||||
18, // Alt
|
||||
19, // Pause
|
||||
20, // Caps
|
||||
27, // Esc
|
||||
33, 34, 35, 36, // PgUp, PgDn, End, Home
|
||||
37, 38, 39, 40, // Directional
|
||||
44, // PrntScrn
|
||||
91, 92, // Win
|
||||
93, // Context
|
||||
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, // F1-12
|
||||
144, // Num
|
||||
145, // Scroll
|
||||
];
|
||||
|
||||
this.inputWorker = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue