loadAuto static method
Implementation
static Map<String, dynamic> loadAuto(String path, String content) {
final extension = path.split('.').last;
switch (extension) {
case 'json':
if (content.contains("//")) {
return jsonDecodeWithComments(content);
} else {
return jsonDecode(content);
}
case 'yaml':
case 'yml':
return YamlUtils.parseYamlToJson(content);
case 'env':
return EnvLoader.loadEnv(content);
case 'toml':
return TomlLoader.fromString(content);
default:
throw UnsupportedError('Unsupported file type: $extension');
}
}