byFlavor static method

Map byFlavor(
  1. String flavor,
  2. String pathMorphemeYaml
)

Implementation

static Map<dynamic, dynamic> byFlavor(
    String flavor, String pathMorphemeYaml) {
  final yaml = YamlHelper.loadFileYaml(pathMorphemeYaml);
  final Map<dynamic, dynamic> mapFlavor = yaml['flavor'] ?? {};
  final map = mapFlavor[flavor] ?? {};
  if (map.isEmpty) {
    StatusHelper.failed('Flavor $flavor not found in morpheme.yaml');
  }
  return map;
}