@pagopa/dx-cli
Version:
A CLI useful to manage DX tools.
10 lines (9 loc) • 347 B
JavaScript
import { Result } from "neverthrow";
import yaml from "yaml";
/**
* Parses YAML content and returns the parsed object.
*
* @param content - The YAML content to parse
* @returns Result with parsed YAML object or error
*/
export const parseYaml = Result.fromThrowable((content) => yaml.parse(content), () => new Error("Failed to parse YAML"));