New top language algorithm implementation (#1732)

* Reduced vercel maxDuration

* Implemented new algorithm for Top Langs

* Revert "Reduced vercel maxDuration"

This reverts commit b0bc626efe12c738cf5005e7f11c7d2a07b6387a.

* Added documentation

* Fixed broken implementation

* Update fetchTopLanguages.test.js

Changed tests

* Now uses the general formula

The parameters p and q can be set by the user.

* Updated tests and added new test

* Added new test

New test for order by repo count.

* Updated documentation

Added explanation and examples for new options.

* Updated documentation

This was overwritten in the merge commit.

* docs: improve docs and fix tests

* Renamed parameters

Renamed `p` and `q` to `size_weight` and `count_weight`, respectively.

* Updated the documentation

Changes introduced in f2516d60a442dfdbb9e24ddda8743664bcb8064d

---------

Co-authored-by: rickstaa <rick.staa@outlook.com>
This commit is contained in:
kitswas
2023-04-25 08:19:05 +02:00
committed by GitHub
co-authored by rickstaa
parent da46a5093c
commit 5577bbf07f
4 changed files with 104 additions and 16 deletions
+4
View File
@@ -25,6 +25,8 @@ export default async (req, res) => {
layout,
langs_count,
exclude_repo,
size_weight,
count_weight,
custom_title,
locale,
border_radius,
@@ -46,6 +48,8 @@ export default async (req, res) => {
const topLangs = await fetchTopLanguages(
username,
parseArray(exclude_repo),
size_weight,
count_weight,
);
const cacheSeconds = clampValue(