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

Commit0efb982

Browse files
authored
Revert "feat: add INCLUDE_ORGS env variable (anuraghazra#2275)" (anuraghazra#2276)
This reverts commitada9cf4.
1 parentada9cf4 commit0efb982

File tree

3 files changed

+10
-29
lines changed

3 files changed

+10
-29
lines changed

‎src/common/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const isValidHexColor = (hexColor) => {
7777
/**
7878
* Returns boolean if value is either "true" or "false" else the value as it is.
7979
*
80-
*@param {string | boolean| undefined} value The value to parse.
80+
*@param {string | boolean} value The value to parse.
8181
*@returns {boolean | undefined} The parsed value.
8282
*/
8383
constparseBoolean=(value)=>{

‎src/fetchers/stats-fetcher.js

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
CustomError,
88
logger,
99
MissingParamError,
10-
parseBoolean,
1110
request,
1211
wrapTextMultiline,
1312
}from"../common/utils.js";
@@ -23,7 +22,7 @@ const fetcher = (variables, token) => {
2322
returnrequest(
2423
{
2524
query:`
26-
query userInfo($login: String!, $ownerAffiliations: [RepositoryAffiliation]) {
25+
query userInfo($login: String!) {
2726
user(login: $login) {
2827
name
2928
login
@@ -46,7 +45,7 @@ const fetcher = (variables, token) => {
4645
followers {
4746
totalCount
4847
}
49-
repositories(ownerAffiliations:$ownerAffiliations) {
48+
repositories(ownerAffiliations:OWNER) {
5049
totalCount
5150
}
5251
}
@@ -71,9 +70,9 @@ const repositoriesFetcher = (variables, token) => {
7170
returnrequest(
7271
{
7372
query:`
74-
query userInfo($login: String!, $after: String, $ownerAffiliations: [RepositoryAffiliation]) {
73+
query userInfo($login: String!, $after: String) {
7574
user(login: $login) {
76-
repositories(first: 100, ownerAffiliations:$ownerAffiliations, orderBy: {direction: DESC, field: STARGAZERS}, after: $after) {
75+
repositories(first: 100, ownerAffiliations:OWNER, orderBy: {direction: DESC, field: STARGAZERS}, after: $after) {
7776
nodes {
7877
name
7978
stargazers {
@@ -150,14 +149,7 @@ const totalStarsFetcher = async (username, repoToHide) => {
150149
lethasNextPage=true;
151150
letendCursor=null;
152151
while(hasNextPage){
153-
constvariables={
154-
login:username,
155-
first:100,
156-
after:endCursor,
157-
ownerAffiliations:parseBoolean(process.env.INCLUDE_ORGS)
158-
?["OWNER","COLLABORATOR"]
159-
:["OWNER"],
160-
};
152+
constvariables={login:username,first:100,after:endCursor};
161153
letres=awaitretryer(repositoriesFetcher,variables);
162154

163155
if(res.data.errors){
@@ -211,12 +203,7 @@ const fetchStats = async (
211203
rank:{level:"C",score:0},
212204
};
213205

214-
letres=awaitretryer(fetcher,{
215-
login:username,
216-
ownerAffiliations:parseBoolean(process.env.INCLUDE_ORGS)
217-
?["OWNER","COLLABORATOR"]
218-
:["OWNER"],
219-
});
206+
letres=awaitretryer(fetcher,{login:username});
220207

221208
// Catch GraphQL errors.
222209
if(res.data.errors){

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
CustomError,
55
logger,
66
MissingParamError,
7-
parseBoolean,
87
request,
98
wrapTextMultiline,
109
}from"../common/utils.js";
@@ -20,10 +19,10 @@ const fetcher = (variables, token) => {
2019
returnrequest(
2120
{
2221
query:`
23-
query userInfo($login: String!, $ownerAffiliations: [RepositoryAffiliation]) {
22+
query userInfo($login: String!) {
2423
user(login: $login) {
2524
# fetch only owner repos & not forks
26-
repositories(ownerAffiliations:$ownerAffiliations, isFork: false, first: 100) {
25+
repositories(ownerAffiliations:OWNER, isFork: false, first: 100) {
2726
nodes {
2827
name
2928
languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
@@ -58,12 +57,7 @@ const fetcher = (variables, token) => {
5857
constfetchTopLanguages=async(username,exclude_repo=[])=>{
5958
if(!username)thrownewMissingParamError(["username"]);
6059

61-
constres=awaitretryer(fetcher,{
62-
login:username,
63-
ownerAffiliations:parseBoolean(process.env.INCLUDE_ORGS)
64-
?["OWNER","COLLABORATOR"]
65-
:["OWNER"],
66-
});
60+
constres=awaitretryer(fetcher,{login:username});
6761

6862
if(res.data.errors){
6963
logger.error(res.data.errors);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp