From a809321b639d2e16c7cbfbbf2b683e0c2d04d8d4 Mon Sep 17 00:00:00 2001 From: CCarpo Date: Mon, 10 Mar 2025 20:55:35 +0100 Subject: [PATCH] renamed function for clarity --- src/core/config/Categories.json | 2 +- .../operations/{BeautifyYAML.mjs => JSONtoYAML.mjs} | 10 +++++----- tests/operations/index.mjs | 4 +--- .../tests/{BeautifyYAML.mjs => JSONtoYAML.mjs} | 4 ++-- 4 files changed, 9 insertions(+), 11 deletions(-) rename src/core/operations/{BeautifyYAML.mjs => JSONtoYAML.mjs} (83%) rename tests/operations/tests/{BeautifyYAML.mjs => JSONtoYAML.mjs} (92%) diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index 1ca519a0..2833cb0a 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -73,7 +73,7 @@ "CBOR Encode", "CBOR Decode", "YAML to JSON", - "Beautify YAML", + "JSON to YAML", "Caret/M-decode", "Rison Encode", "Rison Decode", diff --git a/src/core/operations/BeautifyYAML.mjs b/src/core/operations/JSONtoYAML.mjs similarity index 83% rename from src/core/operations/BeautifyYAML.mjs rename to src/core/operations/JSONtoYAML.mjs index b87573d8..0d4cc626 100644 --- a/src/core/operations/BeautifyYAML.mjs +++ b/src/core/operations/JSONtoYAML.mjs @@ -9,17 +9,17 @@ import OperationError from "../errors/OperationError.mjs"; import YAML from "yaml"; /** - * Beautify YAML operation + * JSON to YAML operation */ -class BeautifyYAML extends Operation { +class JSONtoYAML extends Operation { /** - * BeautifyYAML constructor + * JSONtoYAML constructor */ constructor() { super(); - this.name = "Beautify YAML"; + this.name = "JSON to YAML"; this.module = "Default"; this.description = "Format a JSON object into YAML"; this.infoURL = "https://en.wikipedia.org/wiki/YAML"; @@ -43,4 +43,4 @@ class BeautifyYAML extends Operation { } -export default BeautifyYAML; +export default JSONtoYAML; diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 713496c7..1c25a2ab 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -166,12 +166,10 @@ import "./tests/CBORDecode.mjs"; import "./tests/JA3Fingerprint.mjs"; import "./tests/JA3SFingerprint.mjs"; import "./tests/HASSH.mjs"; -import "./tests/BeautifyYAML.mjs"; - +import "./tests/JSONtoYAML.mjs"; // Cannot test operations that use the File type yet // import "./tests/SplitColourChannels.mjs"; -import "./tests/BeautifyYAML.mjs"; import "./tests/YARA.mjs"; import "./tests/ParseCSR.mjs"; import "./tests/XXTEA.mjs"; diff --git a/tests/operations/tests/BeautifyYAML.mjs b/tests/operations/tests/JSONtoYAML.mjs similarity index 92% rename from tests/operations/tests/BeautifyYAML.mjs rename to tests/operations/tests/JSONtoYAML.mjs index 348991d8..b18998e9 100644 --- a/tests/operations/tests/BeautifyYAML.mjs +++ b/tests/operations/tests/JSONtoYAML.mjs @@ -28,12 +28,12 @@ TestRegister.addTests([ ], }, { - name: "Beautify YAML", + name: "JSON to YAML", input: EXAMPLE_JSON, expectedOutput: `number: 3\nplain: string\n`, recipeConfig: [ { - op: "Beautify YAML", + op: "JSON to YAML", args: [], } ],