linting
This commit is contained in:
parent
c8e306d4f4
commit
3acbe2f744
@ -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…
x
Reference in New Issue
Block a user