2
0
mirror of https://github.com/gchq/CyberChef synced 2025-12-20 10:13:42 +00:00

Tidied up the Magic operation

This commit is contained in:
n1474335
2020-03-24 11:06:37 +00:00
parent 26fa66ef64
commit b765534b8b
43 changed files with 771 additions and 900 deletions

View File

@@ -43,31 +43,9 @@ for (const opObj in Ops) {
flowControl: op.flowControl,
manualBake: op.manualBake,
args: op.args,
checks: op.checks
};
if ("checks" in op) {
if ("input" in op.checks) {
operationConfig[op.name].input = {};
if ("regex" in op.checks.input) {
operationConfig[op.name].input.regex = op.checks.input.regex;
}
if ("entropy" in op.checks.input) {
operationConfig[op.name].input.entropy = op.checks.input.entropy;
}
}
if ("output" in op.checks) {
operationConfig[op.name].output = {};
if ("regex" in op.checks.output) {
operationConfig[op.name].output.regex = op.checks.output.regex;
}
if ("entropy" in op.checks.output) {
operationConfig[op.name].output.entropy = op.checks.output.entropy;
}
if ("mime" in op.checks.output) {
operationConfig[op.name].output.mime = op.checks.output.mime;
}
}
}
if (!(op.module in modules))
modules[op.module] = {};
modules[op.module][op.name] = opObj;