mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 15:25:01 -04:00
feat: add XML to JSON operation
This commit is contained in:
parent
6ed9d4554a
commit
6347f01a47
5 changed files with 86 additions and 0 deletions
24
tests/operations/tests/XMLToJSON.mjs
Normal file
24
tests/operations/tests/XMLToJSON.mjs
Normal file
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* XML to JSON tests.
|
||||
*
|
||||
* @author jpledref [jp.ledref@gmail.com]
|
||||
* @copyright Crown Copyright 2023
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
const EXPECTED_JSON = { "root": {"shelf": ["over"], "wood": ["do"], "natural": ["sale"]}};
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "XML to JSON",
|
||||
input: "<root>\n<shelf>over</shelf>\n<wood>do</wood>\n<natural>sale</natural>\n</root>",
|
||||
expectedOutput: EXPECTED_JSON,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "XML to JSON",
|
||||
args: []
|
||||
},
|
||||
],
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue