Pubspec.fromJson constructor
Implementation
factory Pubspec.fromJson(Map json, {bool lenient = false}) {
if (lenient) {
while (json.isNotEmpty) {
// Attempting to remove top-level properties that cause parsing errors.
try {
return _$PubspecFromJson(json);
} on CheckedFromJsonException catch (e) {
if (e.map == json && json.containsKey(e.key)) {
json = Map.from(json)..remove(e.key);
continue;
}
rethrow;
}
}
}
return _$PubspecFromJson(json);
}