Skip to content

Conversation

@szakarias
Copy link
Contributor

No description provided.

recentDownloads.reduce((prev, element) => prev + element) /
recentDownloads.length;

if (averageRecentDownloads == 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

< 1 might also be worth considering...

Packages with average downloads less than one shouldn't have their growthrate increased..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll keep it in mind but I'll keep it as it is for now. This is the mathematically correct calculation, and hence keeps the abstraction of the function clear. On the caller site we will handle packages with few downloads.

@szakarias szakarias merged commit 56e05ed into dart-lang:master May 7, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants