mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Add yaml parse+mutate+reserialize test
This commit is contained in:
parent
76f7658763
commit
a8b105bdec
3 changed files with 39 additions and 2 deletions
22
backend/src/yamlParseTest.ts
Normal file
22
backend/src/yamlParseTest.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import YAML from "yawn-yaml/cjs";
|
||||
import { load } from "js-yaml";
|
||||
|
||||
const src = `
|
||||
prefix: '!'
|
||||
|
||||
plugins:
|
||||
myplugin:
|
||||
config:
|
||||
|
||||
can_do_thing: true
|
||||
|
||||
# Lol
|
||||
can_do_other_thing: false
|
||||
`;
|
||||
|
||||
const json = load(src);
|
||||
const yaml = new YAML(src);
|
||||
json.plugins.myplugin.config.can_do_thing = false;
|
||||
yaml.json = json;
|
||||
|
||||
console.log(yaml.yaml);
|
Loading…
Add table
Add a link
Reference in a new issue