fix(core): update
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartyaml',
|
||||
version: '3.0.1',
|
||||
description: 'handle yaml in smart ways'
|
||||
name: '@push.rocks/smartyaml',
|
||||
version: '3.0.2',
|
||||
description: 'A module for smart handling of YAML data with support for converting between YAML strings and JavaScript objects.'
|
||||
}
|
||||
|
14
ts/index.ts
14
ts/index.ts
@ -1,15 +1,17 @@
|
||||
import * as plugins from './smartyaml.plugins.js';
|
||||
|
||||
export let yamlStringToObject = async (
|
||||
yamlStringArg,
|
||||
optionsArg: plugins.jsYaml.LoadOptions = {}
|
||||
yamlStringArg: string,
|
||||
): Promise<any> => {
|
||||
return plugins.jsYaml.load(yamlStringArg);
|
||||
return plugins.yaml.parse(yamlStringArg);
|
||||
};
|
||||
|
||||
export let objectToYamlString = async (
|
||||
objectArg,
|
||||
optionsArg: plugins.jsYaml.DumpOptions = {}
|
||||
objectArg
|
||||
): Promise<string> => {
|
||||
return plugins.jsYaml.dump(objectArg);
|
||||
return plugins.yaml.stringify(objectArg);
|
||||
};
|
||||
|
||||
export let getYamlDocFromString = async (stringArg: string) => {
|
||||
return plugins.yaml.parseDocument(stringArg);
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import * as jsYaml from 'js-yaml';
|
||||
import * as yaml from 'yaml';
|
||||
|
||||
export { jsYaml };
|
||||
export { yaml };
|
||||
|
Reference in New Issue
Block a user