2020-01-21 10:01:55 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2019-11-18 09:39:32 -05:00
|
|
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
|
|
|
|
|
|
import { parse } from "../../yaml.ts";
|
|
|
|
|
|
|
|
const { readFileSync, cwd } = Deno;
|
|
|
|
|
2020-03-20 09:38:34 -04:00
|
|
|
(() => {
|
2019-11-18 09:39:32 -05:00
|
|
|
const yml = readFileSync(`${cwd()}/example/sample_document.yml`);
|
|
|
|
|
|
|
|
const document = new TextDecoder().decode(yml);
|
|
|
|
const obj = parse(document) as object;
|
|
|
|
console.log(obj);
|
|
|
|
|
|
|
|
let i = 0;
|
|
|
|
for (const o of Object.values(obj)) {
|
|
|
|
console.log(`======${i}`);
|
|
|
|
for (const [key, value] of Object.entries(o)) {
|
|
|
|
console.log(key, value);
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
})();
|