Skip to content

Commit

Permalink
🔨chore: adds nullish check
Browse files Browse the repository at this point in the history
  • Loading branch information
Adebesin-Cell committed Nov 23, 2024
1 parent a26df42 commit 45c391f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-chairs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@everipedia/iq-utils": minor
---

Adds nullish to linkedWiki object
7 changes: 4 additions & 3 deletions src/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,17 @@ export const Wiki = z
.nullish()
.default([]),
})
.nullish()
.default({
[LinkedWikiKey.Enum.blockchains]: [],
[LinkedWikiKey.Enum.founders]: [],
[LinkedWikiKey.Enum.speakers]: [],
})
.transform((val) => ({
[LinkedWikiKey.Enum.blockchains]:
val[LinkedWikiKey.Enum.blockchains] ?? [],
[LinkedWikiKey.Enum.founders]: val[LinkedWikiKey.Enum.founders] ?? [],
[LinkedWikiKey.Enum.speakers]: val[LinkedWikiKey.Enum.speakers] ?? [],
val?.[LinkedWikiKey.Enum.blockchains] ?? [],
[LinkedWikiKey.Enum.founders]: val?.[LinkedWikiKey.Enum.founders] ?? [],
[LinkedWikiKey.Enum.speakers]: val?.[LinkedWikiKey.Enum.speakers] ?? [],
})),
})
.refine(isEventWikiValid, {
Expand Down

0 comments on commit 45c391f

Please sign in to comment.