Skip to content
Snippets Groups Projects
Unverified Commit e57d2fa3 authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

feat(datasource/dart): Filter out retracted packages (#14022)


* feat(datasource/dart): Filter out retracted packages

* Fix fixture

Co-authored-by: default avatarMichael Kriese <michael.kriese@visualon.de>
Co-authored-by: default avatarRhys Arkins <rhys@arkins.net>
parent f573d828
No related branches found
No related tags found
No related merge requests found
...@@ -83,6 +83,30 @@ ...@@ -83,6 +83,30 @@
"archive_url": "https://pub.dartlang.org/packages/shared_preferences/versions/0.1.1.tar.gz", "archive_url": "https://pub.dartlang.org/packages/shared_preferences/versions/0.1.1.tar.gz",
"published": "2017-05-09T18:25:24.268386Z" "published": "2017-05-09T18:25:24.268386Z"
}, },
{
"version": "0.1.2",
"retracted": true,
"pubspec": {
"version": "0.1.2",
"name": "shared_preferences",
"dependencies": {
"flutter": {
"sdk": "flutter"
}
},
"author": "Flutter Team <flutter-dev@googlegroups.com>",
"flutter": {
"plugin": {
"androidPackage": "io.flutter.plugins.shared_preferences",
"pluginClass": "SharedPreferencesPlugin"
}
},
"description": "A Flutter plugin for reading and writing simple key-value pairs",
"homepage": "https://github.com/flutter/plugins"
},
"archive_url": "https://pub.dartlang.org/packages/shared_preferences/versions/0.1.1.tar.gz",
"published": "2017-05-09T18:25:24.268386Z"
},
{ {
"version": "0.2.0", "version": "0.2.0",
"pubspec": { "pubspec": {
......
...@@ -35,7 +35,9 @@ export class DartDatasource extends Datasource { ...@@ -35,7 +35,9 @@ export class DartDatasource extends Datasource {
const body = raw?.body; const body = raw?.body;
if (body) { if (body) {
const { versions, latest } = body; const { versions, latest } = body;
const releases = versions?.map(({ version, published }) => ({ const releases = versions
?.filter(({ retracted }) => !retracted)
?.map(({ version, published }) => ({
version, version,
releaseTimestamp: published, releaseTimestamp: published,
})); }));
......
...@@ -2,6 +2,7 @@ export interface DartResult { ...@@ -2,6 +2,7 @@ export interface DartResult {
versions?: { versions?: {
version: string; version: string;
published?: string; published?: string;
retracted?: boolean;
}[]; }[];
latest?: { latest?: {
pubspec?: { homepage?: string; repository?: string }; pubspec?: { homepage?: string; repository?: string };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment