packageApitoStorageJson static method
writes the packageApi
to storage (JSON string)
Implementation
static String packageApitoStorageJson(
PackageApi packageApi, {
bool pretty = false,
}) {
final packageApiStorage = _packageApiToStorage(packageApi);
final encoder = pretty ? JsonEncoder.withIndent(' ') : JsonEncoder();
return encoder.convert({
'version': 3,
'packageApi': packageApiStorage.toJson(),
'missingEntryPoints': packageApi
.rootDeclarationsWithoutEntryPointsAndVisibleOutsideTests
.map((e) => e.name)
.toList(),
});
}