mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
Renamed JSON to Yaml to Beautify JSON
This commit is contained in:
@@ -65,7 +65,7 @@
|
|||||||
"CBOR Encode",
|
"CBOR Encode",
|
||||||
"CBOR Decode",
|
"CBOR Decode",
|
||||||
"YAML to JSON",
|
"YAML to JSON",
|
||||||
"JSON to YAML"
|
"Beatufiy YAML"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,19 +9,19 @@ import OperationError from "../errors/OperationError.mjs";
|
|||||||
import YAML from "yaml";
|
import YAML from "yaml";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSON to YAML operation
|
* Beautify YAML operation
|
||||||
*/
|
*/
|
||||||
class JSONToYAML extends Operation {
|
class BeautifyYAML extends Operation {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSONToYAML constructor
|
* BeautifyYAML constructor
|
||||||
*/
|
*/
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.name = "JSON to YAML";
|
this.name = "Beautify YAML";
|
||||||
this.module = "Default";
|
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.infoURL = "https://en.wikipedia.org/wiki/YAML";
|
||||||
this.inputType = "JSON";
|
this.inputType = "JSON";
|
||||||
this.outputType = "string";
|
this.outputType = "string";
|
||||||
@@ -43,4 +43,4 @@ class JSONToYAML extends Operation {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default JSONToYAML;
|
export default BeautifyYAML;
|
||||||
@@ -20,7 +20,7 @@ class YAMLToJSON extends Operation {
|
|||||||
|
|
||||||
this.name = "YAML to JSON";
|
this.name = "YAML to JSON";
|
||||||
this.module = "Default";
|
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.infoURL = "https://en.wikipedia.org/wiki/YAML";
|
||||||
this.inputType = "string";
|
this.inputType = "string";
|
||||||
this.outputType = "JSON";
|
this.outputType = "JSON";
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ import "./tests/CBORDecode.mjs";
|
|||||||
import "./tests/JA3Fingerprint.mjs";
|
import "./tests/JA3Fingerprint.mjs";
|
||||||
import "./tests/JA3SFingerprint.mjs";
|
import "./tests/JA3SFingerprint.mjs";
|
||||||
import "./tests/HASSH.mjs";
|
import "./tests/HASSH.mjs";
|
||||||
import "./tests/YAML.mjs";
|
import "./tests/BeautifyYAML.mjs";
|
||||||
|
|
||||||
|
|
||||||
// Cannot test operations that use the File type yet
|
// Cannot test operations that use the File type yet
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @author ccarpo [ccarpo@gmx.net]
|
* @author ccarpo [ccarpo@gmx.net]
|
||||||
*
|
*
|
||||||
* @copyright Crown Copyright 2018
|
* @copyright Crown Copyright 2021
|
||||||
* @license Apache-2.0
|
* @license Apache-2.0
|
||||||
*/
|
*/
|
||||||
import TestRegister from "../../lib/TestRegister.mjs";
|
import TestRegister from "../../lib/TestRegister.mjs";
|
||||||
@@ -29,12 +29,12 @@ TestRegister.addTests([
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "JSON to YAML",
|
name: "Beautify YAML",
|
||||||
input: EXAMPLE_JSON,
|
input: EXAMPLE_JSON,
|
||||||
expectedOutput: `number: 3\nplain: string\n`,
|
expectedOutput: `number: 3\nplain: string\n`,
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{
|
{
|
||||||
op: "JSON to YAML",
|
op: "Beautify YAML",
|
||||||
args: [],
|
args: [],
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
Reference in New Issue
Block a user