mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 14:11:02 +01:00
update editableOptions wrapper
This commit is contained in:
parent
ffb65d8ea1
commit
c90f30a7a1
@ -56,6 +56,9 @@ function transformArgs(originalArgs, newArgs) {
|
||||
if (["toggleString"].indexOf(argument.type) > -1) {
|
||||
argument.string = newArgs[key].string;
|
||||
argument.option = newArgs[key].option;
|
||||
} else if (argument.type === "editableOption") {
|
||||
// takes key: "option", key: {name, val: "string"}, key: {name, val: [...]}
|
||||
argument.value = typeof newArgs[key] === "string" ? newArgs[key]: newArgs[key].value;
|
||||
} else {
|
||||
argument.value = newArgs[key];
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import {
|
||||
bitShiftRight,
|
||||
cartesianProduct,
|
||||
CSSMinify,
|
||||
toBase64,
|
||||
} from "../../../src/node/index";
|
||||
import TestRegister from "../../TestRegister";
|
||||
|
||||
@ -115,6 +116,22 @@ color: white;
|
||||
preserveComments: true,
|
||||
});
|
||||
assert.strictEqual(result.toString(), "header {// comment width: 100%;color: white;}");
|
||||
}),
|
||||
|
||||
it("toBase64: editableOption", () => {
|
||||
const result = toBase64("some input", {
|
||||
alphabet: {
|
||||
value: "0-9A-W"
|
||||
},
|
||||
});
|
||||
assert.strictEqual(result.toString(), "SPI1R1T0");
|
||||
}),
|
||||
|
||||
it("toBase64: editableOptions key is value", () => {
|
||||
const result = toBase64("some input", {
|
||||
alphabet: "0-9A-W",
|
||||
});
|
||||
assert.strictEqual(result.toString(), "SPI1R1T0");
|
||||
})
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user