github-automated-repos
Version:
The library, ReactJS, that gives you the power to control / automate your GitHub data, your projects on the portfolio / website, in your own GitHub in one place!
29 lines (28 loc) • 1.5 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import { fetchGitHubBanner } from '../api/fetchGitHubBanner';
/**
* @param {string} usernameGitHub - Insert your username GitHub Ex.: https://github.com/USERNAME
* @param {string} repositoryName - Insert the repository name
* @returns {(Promise<string[])} - banners_url[] return an array with banner urls
*/
export function _handleBanner(usernameGitHub, repositoryName) {
return __awaiter(this, void 0, void 0, function* () {
const banners_url = [];
yield fetchGitHubBanner(usernameGitHub, repositoryName).then((repositorie_Banners) => {
repositorie_Banners.forEach((item) => {
if (item.download_url.includes('banner')) {
banners_url.push(item.download_url);
}
});
});
return banners_url;
});
}