SaraS
Convex Community13mo ago
11 replies
Sara

Validate Id<"tableName"> or Doc<"tableName"> on the client or server?

How can we validate the type of Id or Doc in the client with typescript?
I've tried instanceOf, and casting the type but it gives me an error that the type passed is of type any,
The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.ts(2358)

   if(args.Id instanceof Id<"tableName">)
Was this page helpful?