mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-08-14 12:26:03 +00:00
Refactor: Use typedef tags inside request utils function to resolve eslint errors (#3054)
This commit is contained in:
+7
-3
@@ -149,15 +149,19 @@ const fallbackColor = (color, fallbackColor) => {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {import('axios').AxiosRequestConfig['data']} AxiosRequestConfigData Axios request data.
|
||||
* @typedef {import('axios').AxiosRequestConfig['headers']} AxiosRequestConfigHeaders Axios request headers.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Send GraphQL request to GitHub API.
|
||||
*
|
||||
* @param {import('axios').AxiosRequestConfig['data']} data Request data.
|
||||
* @param {import('axios').AxiosRequestConfig['headers']} headers Request headers.
|
||||
* @param {AxiosRequestConfigData} data Request data.
|
||||
* @param {AxiosRequestConfigHeaders} headers Request headers.
|
||||
* @returns {Promise<any>} Request response.
|
||||
*/
|
||||
const request = (data, headers) => {
|
||||
// @ts-ignore
|
||||
return axios({
|
||||
url: "https://api.github.com/graphql",
|
||||
method: "post",
|
||||
|
||||
Reference in New Issue
Block a user