diff --git a/.changeset/serious-foxes-visit.md b/.changeset/serious-foxes-visit.md new file mode 100644 index 0000000..79f86aa --- /dev/null +++ b/.changeset/serious-foxes-visit.md @@ -0,0 +1,5 @@ +--- +"@everipedia/iq-utils": patch +--- + +Fixes null to array transform for linked wikis diff --git a/src/schema/index.ts b/src/schema/index.ts index b006626..9f47e82 100644 --- a/src/schema/index.ts +++ b/src/schema/index.ts @@ -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, {