Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 74 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
"jquery": "3.7.1",
"js-ascon": "^1.3.0",
"js-sha3": "^0.12.0",
"js-yaml": "^5.2.3",
"jsesc": "^3.1.0",
"json5": "^2.2.3",
"jsonata": "^2.2.2",
Expand Down
6 changes: 3 additions & 3 deletions src/core/operations/JSONtoYAML.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs";
import YAML from "yaml";
import { dump } from "js-yaml";

/**
* JSON to YAML operation
Expand Down Expand Up @@ -35,9 +35,9 @@ class JSONtoYAML extends Operation {
*/
run(input, args) {
try {
return YAML.stringify(input);
return dump(input);
} catch (err) {
throw new OperationError("Test");
throw new OperationError("Unable to stringify YAML: " + err);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/core/operations/YAMLToJSON.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs";
import jsYaml from "js-yaml";
import { load } from "js-yaml";

/**
* YAML to JSON operation
*/
Expand Down Expand Up @@ -34,7 +35,7 @@ class YAMLToJSON extends Operation {
*/
run(input, args) {
try {
return jsYaml.load(input);
return load(input);
} catch (err) {
throw new OperationError("Unable to parse YAML: " + err);
}
Expand Down