Skip to content

Commit

Permalink
🔨chore: adds default empty array for linkedWikis, transforms null values
Browse files Browse the repository at this point in the history
  • Loading branch information
Adebesin-Cell committed Nov 22, 2024
1 parent 40b6916 commit 03e8e40
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-foxes-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@everipedia/iq-utils": patch
---

Fixes null to array transform for linked wikis
13 changes: 9 additions & 4 deletions src/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,23 @@ export const Wiki = z
.object({
[LinkedWikiKey.Enum.blockchains]: z
.array(z.string())
.nullish()
.nullable()
.transform((val) => val ?? [])
.default([]),

[LinkedWikiKey.Enum.founders]: z
.array(z.string())
.nullish()
.nullable()
.transform((val) => val ?? [])
.default([]),

[LinkedWikiKey.Enum.speakers]: z
.array(z.string())
.nullish()
.nullable()
.transform((val) => val ?? [])
.default([]),
})
.nullish()
.nullable()
.default({}),
})
.refine(isEventWikiValid, {
Expand Down

0 comments on commit 03e8e40

Please sign in to comment.