3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

Add yaml parse+mutate+reserialize test

This commit is contained in:
Dragory 2020-10-19 20:10:16 +03:00
parent fd71119098
commit 70efc9a26e
3 changed files with 39 additions and 2 deletions

View 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);