parseJson method
Parses the output of the process as JSON.
Implementation
Map<String, dynamic> parseJson({
String Function(String value)? transform,
}) {
final value =
transform == null ? asJoinedOutput : transform(asJoinedOutput);
try {
return json.decode(value) as Map<String, dynamic>;
} on FormatException catch (_) {
throw ToolException(
'Unable to parse output as JSON:\n\n```\n$asTrimmedOutput\n```\n');
}
}