22 lines
358 B
TypeScript
22 lines
358 B
TypeScript
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);
|