fromYaml static method

RawConfig? fromYaml(
  1. String rawYaml, [
  2. bool isSlangYaml = false
])

Parses the full build.yaml file to get the config May return null if no config entry is found.

Implementation

static RawConfig? fromYaml(String rawYaml, [bool isSlangYaml = false]) {
  final parsedYaml = loadYaml(rawYaml);
  if (parsedYaml == null) {
    return null;
  }
  final YamlMap? configEntry =
      isSlangYaml ? parsedYaml as YamlMap? : _findConfigEntry(parsedYaml);
  if (configEntry == null) {
    return null;
  }

  final map = MapUtils.deepCast(configEntry.value);
  return fromMap(map);
}