mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 23:36:16 -04:00
Added eslint space-before-blocks rule
This commit is contained in:
parent
44b90be7d6
commit
094d352e5f
17 changed files with 23 additions and 22 deletions
|
@ -64,7 +64,7 @@ class BlurImage extends Operation {
|
|||
throw new OperationError(`Error loading image. (${err})`);
|
||||
}
|
||||
try {
|
||||
switch (blurType){
|
||||
switch (blurType) {
|
||||
case "Fast":
|
||||
if (isWorkerEnvironment())
|
||||
self.sendStatusMessage("Fast blurring image...");
|
||||
|
|
|
@ -111,7 +111,7 @@ class DNSOverHTTPS extends Operation {
|
|||
* @returns {JSON}
|
||||
*/
|
||||
function extractData(data) {
|
||||
if (typeof(data) == "undefined"){
|
||||
if (typeof(data) == "undefined") {
|
||||
return [];
|
||||
} else {
|
||||
const dataValues = [];
|
||||
|
|
|
@ -58,7 +58,7 @@ class FlipImage extends Operation {
|
|||
try {
|
||||
if (isWorkerEnvironment())
|
||||
self.sendStatusMessage("Flipping image...");
|
||||
switch (flipAxis){
|
||||
switch (flipAxis) {
|
||||
case "Horizontal":
|
||||
image.flip(true, false);
|
||||
break;
|
||||
|
|
|
@ -47,7 +47,7 @@ class GenerateLoremIpsum extends Operation {
|
|||
*/
|
||||
run(input, args) {
|
||||
const [length, lengthType] = args;
|
||||
if (length < 1){
|
||||
if (length < 1) {
|
||||
throw new OperationError("Length must be greater than 0");
|
||||
}
|
||||
switch (lengthType) {
|
||||
|
|
|
@ -48,7 +48,7 @@ class ImageFilter extends Operation {
|
|||
*/
|
||||
async run(input, args) {
|
||||
const [filterType] = args;
|
||||
if (!isImage(new Uint8Array(input))){
|
||||
if (!isImage(new Uint8Array(input))) {
|
||||
throw new OperationError("Invalid file type.");
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class MicrosoftScriptDecoder extends Operation {
|
|||
run(input, args) {
|
||||
const matcher = /#@~\^.{6}==(.+).{6}==\^#~@/;
|
||||
const encodedData = matcher.exec(input);
|
||||
if (encodedData){
|
||||
if (encodedData) {
|
||||
return MicrosoftScriptDecoder._decode(encodedData[1]);
|
||||
} else {
|
||||
return "";
|
||||
|
|
|
@ -134,7 +134,7 @@ CMYK: ${cmyk}
|
|||
static _hslToRgb(h, s, l) {
|
||||
let r, g, b;
|
||||
|
||||
if (s === 0){
|
||||
if (s === 0) {
|
||||
r = g = b = l; // achromatic
|
||||
} else {
|
||||
const hue2rgb = function hue2rgb(p, q, t) {
|
||||
|
|
|
@ -62,7 +62,7 @@ class SharpenImage extends Operation {
|
|||
async run(input, args) {
|
||||
const [radius, amount, threshold] = args;
|
||||
|
||||
if (!isImage(new Uint8Array(input))){
|
||||
if (!isImage(new Uint8Array(input))) {
|
||||
throw new OperationError("Invalid file type.");
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class SwapEndianness extends Operation {
|
|||
const word = data.slice(i, i + wordLength);
|
||||
|
||||
// Pad word if too short
|
||||
if (padIncompleteWords && word.length < wordLength){
|
||||
if (padIncompleteWords && word.length < wordLength) {
|
||||
for (j = word.length; j < wordLength; j++) {
|
||||
word.push(0);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ class UNIXTimestampToWindowsFiletime extends Operation {
|
|||
|
||||
input = new BigNumber(input);
|
||||
|
||||
if (units === "Seconds (s)"){
|
||||
if (units === "Seconds (s)") {
|
||||
input = input.multipliedBy(new BigNumber("10000000"));
|
||||
} else if (units === "Milliseconds (ms)") {
|
||||
input = input.multipliedBy(new BigNumber("10000"));
|
||||
|
@ -65,7 +65,7 @@ class UNIXTimestampToWindowsFiletime extends Operation {
|
|||
|
||||
input = input.plus(new BigNumber("116444736000000000"));
|
||||
|
||||
if (format === "Hex"){
|
||||
if (format === "Hex") {
|
||||
return input.toString(16);
|
||||
} else {
|
||||
return input.toFixed();
|
||||
|
|
|
@ -57,7 +57,7 @@ class WindowsFiletimeToUNIXTimestamp extends Operation {
|
|||
|
||||
input = input.minus(new BigNumber("116444736000000000"));
|
||||
|
||||
if (units === "Seconds (s)"){
|
||||
if (units === "Seconds (s)") {
|
||||
input = input.dividedBy(new BigNumber("10000000"));
|
||||
} else if (units === "Milliseconds (ms)") {
|
||||
input = input.dividedBy(new BigNumber("10000"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue