Files
plainleaf/plug-api/syscalls/yaml.ts
T
Zef Hemel c93d656ac6 Significant refactor of index
* Moved YAML library import to index plug (so no async syscalls anymore)
  should speed things up
* Merged task and item indexing
* Merged tasks plug into index (questionable)
* taskstate is now no longer a tag, but needs to be configured via
  configs
2026-01-07 11:00:32 +01:00

29 lines
621 B
TypeScript

import { syscall } from "../syscall.ts";
/**
* YAML operations, exposed via `index` plug
* @module
*/
/**
* Parses a YAML string into a JavaScript object.
* @param text the YAML text to parse
* @returns a JavaScript object representation of the YAML text
*/
export function parse(
text: string,
): Promise<any> {
return syscall("yaml.parse", text);
}
/**
* Converts a JavaScript object into a YAML string.
* @param obj the object to stringify
* @returns a YAML string representation of the object
*/
export function stringify(
obj: any,
): Promise<string> {
return syscall("yaml.stringify", obj);
}