tryParsePubspec function
Try parsing the pubspec of the given directory.
If the parsing fails for any reason, returns null.
Implementation
Future<Pubspec?> tryParsePubspec(Directory directory) async {
try {
return await parsePubspec(directory);
} catch (_) {
return null;
}
}