@plumbiu/github-info
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -1,2 +0,2 @@ | ||
async function l(e){return await(await fetch(e)).json()}function i(e){return e?.map(a=>({id:a.id,name:a.name,fullName:a.full_name,url:a.html_url,description:a.description,language:a.language,star:a.stargazers_count,watchers:a.watchers,forks:a.forks,issue:a.open_issues,license:a.license?.name,created_at:a.created_at,updated_at:a.updated_at,pushed_at:a.pushed_at,owner:{user:a.owner?.login,avatar:a.owner?.avatar_url}}))}function n(e){if(!e)return;let{login:a,avatar_url:t,html_url:r}=e;return{name:a,avatar:t,url:r}}function u(e){let{merged_by:a,user:t,head:r,base:s}=e,o=r.repo;return{html_url:e.html_url,diff_url:e.diff_url,patch_url:e.patch_url,state:e.state,locked:e.locked,body:e.body,created_at:e.created_at,updated_at:e.updated_at,closed_at:e.closed_at,merged_at:{name:a?.login,url:a?.html_url},merged_by:n(a),comments:e.comments,additions:e.additions,deletions:e.deletions,changed_files:e.changed_files,user:n(t),head:{label:r.label,ref:r.ref,user:n(r.user),repo:{name:o.name,fullName:o.full_name,description:o.description,language:o.language,license:o.license.name}},base:{label:s.label,ref:s.ref,user:n(s.user)}}}async function d(e){return{async userField(){let a=await l(`https://api.github.com/users/${e}`);return{bio:a.bio,name:a.login,company:a.company,blog:a.blog,location:a.location,email:a.email,avatar:a.avatar_url,twitter:a.twitter_username,created_at:a.created_at,updated_at:a.updated_at}},async followersField(){return(await l(`https://api.github.com/users/${e}/followers`))?.map(t=>({id:t.id,user:t.login,avatar:t.avatar_url}))},async followingField(){return(await l(`https://api.github.com/users/${e}/following`))?.map(t=>({id:t.id,user:t.login,avatar:t.avatar_url}))},async starredField(){let a=await l(`https://api.github.com/users/${e}/starred`);return i(a)},async reposField(){let a=await l(`https://api.github.com/users/${e}/repos`);return i(a)},async eventsField(){return(await l(`https://api.github.com/users/${e}/events`))?.map(t=>{let r=t.payload?.pull_request,s={id:t.id,type:t.type,created_at:t.created_at,org:{name:t.org?.login,avatar:t.org?.avatar_url},actor:{name:t.actor?.login,avatar:t.actor?.avatar_url},repo:t.repo.name,payload:{ref:t.payload.ref,commits:t.payload.commits?.map(o=>({author:o.author,message:o.message}))}};return r&&(s.pull_request=u(r)),s})}}}async function F(e){let{userField:a,followersField:t,followingField:r,starredField:s,reposField:o,eventsField:c}=await d(e),p=await a(),f=await t(),g=await r(),_=await s(),w=await o(),h=await c();return{user:p,public_repos:w,followers:f,following:g,starred:_,events:h}}export{d as initFields,F as profileInfo}; | ||
async function l(e){return await(await fetch(e,{cache:"force-cache"})).json()}function i(e){return e?.map(a=>({id:a.id,name:a.name,fullName:a.full_name,url:a.html_url,description:a.description,language:a.language,star:a.stargazers_count,watchers:a.watchers,forks:a.forks,issue:a.open_issues,license:a.license?.name,created_at:a.created_at,updated_at:a.updated_at,pushed_at:a.pushed_at,owner:{user:a.owner?.login,avatar:a.owner?.avatar_url}}))}function n(e){if(!e)return;let{login:a,avatar_url:t,html_url:r}=e;return{name:a,avatar:t,url:r}}function u(e){let{merged_by:a,user:t,head:r,base:s}=e,o=r.repo;return{html_url:e.html_url,diff_url:e.diff_url,patch_url:e.patch_url,state:e.state,locked:e.locked,body:e.body,created_at:e.created_at,updated_at:e.updated_at,closed_at:e.closed_at,merged_at:{name:a?.login,url:a?.html_url},merged_by:n(a),comments:e.comments,additions:e.additions,deletions:e.deletions,changed_files:e.changed_files,user:n(t),head:{label:r.label,ref:r.ref,user:n(r.user),repo:{name:o.name,fullName:o.full_name,description:o.description,language:o.language,license:o.license.name}},base:{label:s.label,ref:s.ref,user:n(s.user)}}}async function d(e){return{async userField(){let a=await l(`https://api.github.com/users/${e}`);return{bio:a.bio,name:a.login,company:a.company,blog:a.blog,location:a.location,email:a.email,avatar:a.avatar_url,twitter:a.twitter_username,created_at:a.created_at,updated_at:a.updated_at}},async followersField(){return(await l(`https://api.github.com/users/${e}/followers`))?.map(t=>({id:t.id,user:t.login,avatar:t.avatar_url}))},async followingField(){return(await l(`https://api.github.com/users/${e}/following`))?.map(t=>({id:t.id,user:t.login,avatar:t.avatar_url}))},async starredField(){let a=await l(`https://api.github.com/users/${e}/starred`);return i(a)},async reposField(){let a=await l(`https://api.github.com/users/${e}/repos`);return i(a)},async eventsField(){return(await l(`https://api.github.com/users/${e}/events`))?.map(t=>{let r=t.payload?.pull_request,s={id:t.id,type:t.type,created_at:t.created_at,org:{name:t.org?.login,avatar:t.org?.avatar_url},actor:{name:t.actor?.login,avatar:t.actor?.avatar_url},repo:t.repo.name,payload:{ref:t.payload.ref,commits:t.payload.commits?.map(o=>({author:o.author,message:o.message}))}};return r&&(s.pull_request=u(r)),s})}}}async function F(e){let{userField:a,followersField:t,followingField:r,starredField:s,reposField:o,eventsField:c}=await d(e),p=await a(),f=await t(),g=await r(),_=await s(),w=await o(),h=await c();return{user:p,public_repos:w,followers:f,following:g,starred:_,events:h}}export{d as initFields,F as profileInfo}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@plumbiu/github-info", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Get the github profile information!", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
22510