Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf2516d6

Browse files
committed
Renamed parameters
Renamed `p` and `q` to `size_weight` and `count_weight`, respectively.
1 parent9ce9bde commitf2516d6

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

‎api/top-langs.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export default async (req, res) => {
2525
layout,
2626
langs_count,
2727
exclude_repo,
28-
p,
29-
q,
28+
size_weight,
29+
count_weight,
3030
custom_title,
3131
locale,
3232
border_radius,
@@ -48,8 +48,8 @@ export default async (req, res) => {
4848
consttopLangs=awaitfetchTopLanguages(
4949
username,
5050
parseArray(exclude_repo),
51-
p,
52-
q,
51+
size_weight,
52+
count_weight,
5353
);
5454

5555
constcacheSeconds=clampValue(

‎src/fetchers/top-languages-fetcher.js‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ const fetcher = (variables, token) => {
5454
*@param {string[]} exclude_repo List of repositories to exclude.
5555
*@returns {Promise<import("./types").TopLangData>} Top languages data.
5656
*/
57-
constfetchTopLanguages=async(username,exclude_repo=[],p=1,q=0)=>{
57+
constfetchTopLanguages=async(
58+
username,
59+
exclude_repo=[],
60+
size_weight=1,
61+
count_weight=0,
62+
)=>{
5863
if(!username)thrownewMissingParamError(["username"]);
5964

6065
constres=awaitretryer(fetcher,{login:username});
@@ -136,7 +141,8 @@ const fetchTopLanguages = async (username, exclude_repo = [], p = 1, q = 0) => {
136141
Object.keys(repoNodes).forEach((name)=>{
137142
// comparison index calculation
138143
repoNodes[name].size=
139-
Math.pow(repoNodes[name].size,p)*Math.pow(repoNodes[name].count,q);
144+
Math.pow(repoNodes[name].size,size_weight)*
145+
Math.pow(repoNodes[name].count,count_weight);
140146
});
141147

142148
consttopLangs=Object.keys(repoNodes)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp