mirror of
https://github.com/anuraghazra/github-readme-stats.git
synced 2024-12-27 06:25:47 +08:00
Refactor: Repo card: Use typedef tags inside data fetcher to resolve eslint errors (#3043)
This commit is contained in:
parent
036f80f7ae
commit
3b975d0fbc
@ -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…
Reference in New Issue
Block a user