2023-05-23 18:53:53 +00:00
|
|
|
import { SysCallMapping } from "../../plugos/system.ts";
|
2023-10-03 12:16:33 +00:00
|
|
|
import { YAML } from "../../web/deps.ts";
|
2023-05-23 18:53:53 +00:00
|
|
|
|
|
|
|
export function yamlSyscalls(): SysCallMapping {
|
|
|
|
return {
|
|
|
|
"yaml.parse": (_ctx, text: string): any => {
|
|
|
|
return YAML.parse(text);
|
|
|
|
},
|
|
|
|
"yaml.stringify": (_ctx, obj: any): string => {
|
2023-08-23 17:08:21 +00:00
|
|
|
return YAML.stringify(obj, {
|
|
|
|
noArrayIndent: true,
|
|
|
|
noCompatMode: true,
|
|
|
|
});
|
2023-05-23 18:53:53 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|