https://api.github.com/BrycensRanch/AuthIsForMe/blob/1111033ba86baacb8e52f33bca6579a243eedb31/frontend/src/pages/thanks.tsx#L69
setLicenses(
await Promise.all(
[...Object.keys(dependencies), ...Object.keys(devDependencies)].map(async dep => {
// TODO: Add back types in a more sane way
let npmPackage: any;
try {
npmPackage = await ky.get(`https://registry.npmjs.org/${dep}`).json();
const normalizedRepoURL = new URL(
npmPackage.repository?.url.replace(/\.git$/, '').replace('git+', '') || `https://github.com/npm/${dep}`,
);
normalizedRepoURL.protocol = 'https';
if (npmPackage.repository?.url && npmPackage.repository?.type === 'git') {
const repoDefaultBranch = await getRepoDefaultBranch(normalizedRepoURL.href);
console.log(normalizedRepoURL.href, repoDefaultBranch);
// license = await ky
https://api.github.com/BrycensRanch/AuthIsForMe/blob/1111033ba86baacb8e52f33bca6579a243eedb31/frontend/src/pages/thanks.tsx#L69