From 4255d8d543226969381adc1c6a06f421e76ac6d8 Mon Sep 17 00:00:00 2001 From: ccarpo Date: Tue, 21 Nov 2023 09:19:58 +0100 Subject: [PATCH] Renamed JSON to Yaml to Beautify JSON --- src/core/config/Categories.json | 2 +- .../operations/{JSONToYAML.mjs => BeautifyYAML.mjs} | 12 ++++++------ src/core/operations/YAMLToJSON.mjs | 2 +- tests/operations/index.mjs | 2 +- .../operations/tests/{YAML.mjs => BeautifyYAML.mjs} | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) rename src/core/operations/{JSONToYAML.mjs => BeautifyYAML.mjs} (76%) rename tests/operations/tests/{YAML.mjs => BeautifyYAML.mjs} (89%) diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index e35bc851..6e5e7f04 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -65,7 +65,7 @@ "CBOR Encode", "CBOR Decode", "YAML to JSON", - "JSON to YAML" + "Beautify YAML" ] }, { diff --git a/src/core/operations/JSONToYAML.mjs b/src/core/operations/BeautifyYAML.mjs similarity index 76% rename from src/core/operations/JSONToYAML.mjs rename to src/core/operations/BeautifyYAML.mjs index 2c8102e0..b87573d8 100644 --- a/src/core/operations/JSONToYAML.mjs +++ b/src/core/operations/BeautifyYAML.mjs @@ -9,19 +9,19 @@ import OperationError from "../errors/OperationError.mjs"; import YAML from "yaml"; /** - * JSON to YAML operation + * Beautify YAML operation */ -class JSONToYAML extends Operation { +class BeautifyYAML extends Operation { /** - * JSONToYAML constructor + * BeautifyYAML constructor */ constructor() { super(); - this.name = "JSON to YAML"; + this.name = "Beautify YAML"; this.module = "Default"; - this.description = "Converts a JSON into a YAML"; + this.description = "Format a JSON object into YAML"; this.infoURL = "https://en.wikipedia.org/wiki/YAML"; this.inputType = "JSON"; this.outputType = "string"; @@ -43,4 +43,4 @@ class JSONToYAML extends Operation { } -export default JSONToYAML; +export default BeautifyYAML; diff --git a/src/core/operations/YAMLToJSON.mjs b/src/core/operations/YAMLToJSON.mjs index 4f77f4fd..5b986575 100644 --- a/src/core/operations/YAMLToJSON.mjs +++ b/src/core/operations/YAMLToJSON.mjs @@ -20,7 +20,7 @@ class YAMLToJSON extends Operation { this.name = "YAML to JSON"; this.module = "Default"; - this.description = "Converts a YAML to JSON"; + this.description = "Convert YAML to JSON"; this.infoURL = "https://en.wikipedia.org/wiki/YAML"; this.inputType = "string"; this.outputType = "JSON"; diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 3f7a7457..475d6d31 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -107,7 +107,7 @@ import "./tests/CBORDecode.mjs"; import "./tests/JA3Fingerprint.mjs"; import "./tests/JA3SFingerprint.mjs"; import "./tests/HASSH.mjs"; -import "./tests/YAML.mjs"; +import "./tests/BeautifyYAML.mjs"; // Cannot test operations that use the File type yet diff --git a/tests/operations/tests/YAML.mjs b/tests/operations/tests/BeautifyYAML.mjs similarity index 89% rename from tests/operations/tests/YAML.mjs rename to tests/operations/tests/BeautifyYAML.mjs index ba72ed43..f2cc58fb 100644 --- a/tests/operations/tests/YAML.mjs +++ b/tests/operations/tests/BeautifyYAML.mjs @@ -4,7 +4,7 @@ * * @author ccarpo [ccarpo@gmx.net] * - * @copyright Crown Copyright 2018 + * @copyright Crown Copyright 2021 * @license Apache-2.0 */ import TestRegister from "../../lib/TestRegister.mjs"; @@ -29,12 +29,12 @@ TestRegister.addTests([ ], }, { - name: "JSON to YAML", + name: "Beautify YAML", input: EXAMPLE_JSON, expectedOutput: `number: 3\nplain: string\n`, recipeConfig: [ { - op: "JSON to YAML", + op: "Beautify YAML", args: [], } ],