{"version":3,"file":"yaml.mjs","names":[],"sources":["../src/yaml.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n                       ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n  DocumentOptions,\n  ParseOptions,\n  SchemaOptions,\n  ToJSOptions\n} from \"yaml\";\nimport { parse } from \"yaml\";\nimport { readFile, readFileSync } from \"./read-file\";\n\nexport type YamlReadOptions = ParseOptions &\n  DocumentOptions &\n  SchemaOptions &\n  ToJSOptions;\n\n/**\n * Reads a YAML file and returns the object the YAML content represents.\n *\n * @param path - A path to a file.\n * @param options - YAML parse options\n * @returns Object the YAML content of the file represents\n */\nexport function readYamlFileSync<T extends object = any>(\n  path: string,\n  options?: YamlReadOptions\n): T {\n  return parse(readFileSync(path), options) as T;\n}\n\n/**\n * Reads a YAML file and returns the object the YAML content represents.\n *\n * @param path - A path to a file.\n * @param options - YAML parse options\n * @returns Object the YAML content of the file represents\n */\nexport async function readYamlFile<T extends object = any>(\n  path: string,\n  options: YamlReadOptions = {}\n): Promise<T> {\n  return parse(await readFile(path), options) as T;\n}\n"],"mappings":";;;;;;;;;;;AAuCA,SAAgB,iBACd,MACA,SACG;AACH,QAAO,MAAM,aAAa,KAAK,EAAE,QAAQ;;;;;;;;;AAU3C,eAAsB,aACpB,MACA,UAA2B,EAAE,EACjB;AACZ,QAAO,MAAM,MAAM,SAAS,KAAK,EAAE,QAAQ"}