yamlDoc function

YamlMap yamlDoc(
  1. String path, [
  2. File? file
])

Retrieve Yaml document with given path.

Implementation

YamlMap yamlDoc(String path, [File? file]) {
  final yamlFile = file ?? File(path);
  final contents = yamlFile.readAsStringSync();
  final doc = loadYaml(contents) as YamlMap;
  return doc;
}