mirror of
https://github.com/System-End/github-readme-stats.git
synced 2026-04-20 00:35:23 +00:00
Refactor: Repo card: Use typedef tags inside data fetcher to resolve eslint errors (#3043)
This commit is contained in:
parent
036f80f7ae
commit
3b975d0fbc
1 changed files with 12 additions and 3 deletions
|
|
@ -2,12 +2,17 @@
|
|||
import { retryer } from "../common/retryer.js";
|
||||
import { MissingParamError, request } from "../common/utils.js";
|
||||
|
||||
/**
|
||||
* @typedef {import('axios').AxiosRequestHeaders} AxiosRequestHeaders Axios request headers.
|
||||
* @typedef {import('axios').AxiosResponse} AxiosResponse Axios response.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Repo data fetcher.
|
||||
*
|
||||
* @param {import('axios').AxiosRequestHeaders} variables Fetcher variables.
|
||||
* @param {AxiosRequestHeaders} variables Fetcher variables.
|
||||
* @param {string} token GitHub token.
|
||||
* @returns {Promise<import('axios').AxiosResponse>} The response.
|
||||
* @returns {Promise<AxiosResponse>} The response.
|
||||
*/
|
||||
const fetcher = (variables, token) => {
|
||||
return request(
|
||||
|
|
@ -53,12 +58,16 @@ const fetcher = (variables, token) => {
|
|||
|
||||
const urlExample = "/api/pin?username=USERNAME&repo=REPO_NAME";
|
||||
|
||||
/**
|
||||
* @typedef {import("./types").RepositoryData} RepositoryData Repository data.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fetch repository data.
|
||||
*
|
||||
* @param {string} username GitHub username.
|
||||
* @param {string} reponame GitHub repository name.
|
||||
* @returns {Promise<import("./types").RepositoryData>} Repository data.
|
||||
* @returns {Promise<RepositoryData>} Repository data.
|
||||
*/
|
||||
const fetchRepo = async (username, reponame) => {
|
||||
if (!username && !reponame) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue