Zod Aide lets you add methods to your Zod schemas by using the zodSchemaProxy
function. Here’s a sample usage:
In the above example, The syntheticSchema is defined as a Zod schema
representing an object with text (a string), url (a URL conformant string),
and number (a number). The zodSchemaProxy function is then used to create
proxiedSchema, which is a proxied version of the syntheticSchema with
additional methods(isText, isNumberInRange, aliasForText). Finally, an
object is parsed using the proxiedSchema. This parsed object can then be
interacted with using the extra methods, such as isText, which verifies if the
text field of the object matches a specific string.