mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
23 lines
397 B
TypeScript
23 lines
397 B
TypeScript
import { load } from "js-yaml";
|
|
import YAML from "yawn-yaml/cjs";
|
|
|
|
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;
|
|
|
|
// tslint:disable-next-line:no-console
|
|
console.log(yaml.yaml);
|