A Zod schema that validates "thenable" objects with a .then() method.
This schema validates objects that implement the PromiseLike interface by
having a .then() method, which includes Promises and other thenable
objects. Unlike Zod's built-in z.promise(), this schema does not unwrap the
resolved value, meaning the result of parsing remains a Promise or thenable
object.
A Zod schema that validates "thenable" objects with a
.then()
method.This schema validates objects that implement the PromiseLike interface by having a
.then()
method, which includes Promises and other thenable objects. Unlike Zod's built-inz.promise()
, this schema does not unwrap the resolved value, meaning the result of parsing remains a Promise or thenable object.