Skip to content

Commit

Permalink
feat: optimize the code
Browse files Browse the repository at this point in the history
  • Loading branch information
imfycc committed Nov 7, 2021
1 parent 0b31a81 commit f929d9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Github {
return (data.starredRepositories.edges || []).map(({ node, starredAt }) => ({
...node,
starredAt,
repositoryTopics: (node.repositoryTopics.nodes || []).map(
repositoryTopics: (node?.repositoryTopics?.nodes || []).map(
(o: GithubRepositoryTopic): RepositoryTopic => ({ name: o?.topic?.name })
),
}))
Expand Down
4 changes: 2 additions & 2 deletions libs/notion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ export class Notion {
"Primary Language": {
type: 'select',
select: {
name: repo.primaryLanguage.name,
name: repo?.primaryLanguage?.name || 'null',
},
},
"Repository Topics": {
type: 'multi_select',
multi_select: repo.repositoryTopics,
multi_select: repo.repositoryTopics || [],
},
'Starred At': {
type: 'date',
Expand Down

0 comments on commit f929d9c

Please sign in to comment.