Open
Description
When creating a table with a null
variable, it's possible to pass an undefined
value to the patch
function without TypeScript raising an error — even though this will crash at runtime.
export const test = defineTable({
nullVariable: v.union(v.null(), v.string()),
undefinedVariable: v.optional(v.string()),
})
await ctx.db.patch(testId, {
nullVariable: undefined, // <--------- no TypeScript error
undefinedVariable: null // <--------- TypeScript error
})
Expected behavior: TypeScript should warn that undefined
is not a valid value for nullVariable
.
Metadata
Metadata
Assignees
Labels
No labels