mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00
linting
This commit is contained in:
parent
c8e306d4f4
commit
3acbe2f744
2 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,7 @@
|
||||||
* @license Apache-2.0
|
* @license Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import YAML from 'yaml'
|
import YAML from "yaml";
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class JSONToYAML extends Operation {
|
||||||
const doc = new YAML.Document();
|
const doc = new YAML.Document();
|
||||||
try {
|
try {
|
||||||
doc.contents = JSON.parse(input.replace(/(\w+):/gm, `"$1":`));
|
doc.contents = JSON.parse(input.replace(/(\w+):/gm, `"$1":`));
|
||||||
return doc.toString()
|
return doc.toString();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new OperationError("Unable to parse JSON to YAML: " + err.toString());
|
throw new OperationError("Unable to parse JSON to YAML: " + err.toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* @license Apache-2.0
|
* @license Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import YAML from 'yaml'
|
import YAML from "yaml";
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue