mirror of
https://github.com/gchq/CyberChef
synced 2025-12-11 05:43:28 +00:00
ESM: Tidied up recently added operations
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import { fromBase64, toBase64 } from "../lib/Base64";
|
||||
import { fromHex } from "../lib/Hex";
|
||||
import Operation from "../Operation";
|
||||
import OperationError from "../errors/OperationError";
|
||||
import Utils from "../Utils";
|
||||
import Magic from "../lib/Magic";
|
||||
|
||||
@@ -37,9 +38,7 @@ class RenderImage extends Operation {
|
||||
{
|
||||
"match": "^(?:\\xff\\xd8\\xff|\\x89\\x50\\x4e\\x47|\\x47\\x49\\x46|.{8}\\x57\\x45\\x42\\x50|\\x42\\x4d)",
|
||||
"flags": "",
|
||||
"args": [
|
||||
"Raw"
|
||||
],
|
||||
"args": ["Raw"],
|
||||
"useful": true
|
||||
}
|
||||
];
|
||||
@@ -77,7 +76,7 @@ class RenderImage extends Operation {
|
||||
if (type && type.mime.indexOf("image") === 0) {
|
||||
dataURI += type.mime + ";";
|
||||
} else {
|
||||
throw "Invalid file type";
|
||||
throw new OperationError("Invalid file type");
|
||||
}
|
||||
|
||||
// Add image data to URI
|
||||
|
||||
Reference in New Issue
Block a user