mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
ESM: Tidied up recently added operations
This commit is contained in:
parent
6a561185df
commit
3f3a3e0016
12 changed files with 2082 additions and 2069 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue