smartyaml/ts/index.ts

18 lines
425 B
TypeScript
Raw Normal View History

2022-05-20 13:22:56 +00:00
import * as plugins from './smartyaml.plugins.js';
2017-05-25 13:09:01 +00:00
export let yamlStringToObject = async (
2024-04-30 15:49:25 +00:00
yamlStringArg: string,
): Promise<any> => {
2024-04-30 15:49:25 +00:00
return plugins.yaml.parse(yamlStringArg);
};
2017-05-25 13:09:01 +00:00
export let objectToYamlString = async (
2024-04-30 15:49:25 +00:00
objectArg
): Promise<string> => {
2024-04-30 15:49:25 +00:00
return plugins.yaml.stringify(objectArg);
};
2024-04-30 15:49:25 +00:00
export let getYamlDocFromString = async (stringArg: string) => {
return plugins.yaml.parseDocument(stringArg);
}