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