arktypea
arktype10mo ago
TheGuy

How to choose "one of" in a type?

Hi there!

export const user_find_one_controller_input = type({
  "_id?": userApi.schema.user.get("_id"),
  "_email?": userApi.schema.user.get("email")
});


For example here I am wanting to have either or as an object. So saying that if there is no _id then there has to be an "email" and visa versa. Not sure how to achieve this

Thanks!
Was this page helpful?