Checks if the value is one of the provided options.
const userRole = union(["admin", "user"]);userRole("super-admin"); // Error: unionuserRole("admin"); // passesuserRole("user"); // passes Copy
const userRole = union(["admin", "user"]);userRole("super-admin"); // Error: unionuserRole("admin"); // passesuserRole("user"); // passes
Options to be validated against.
Checks if the value is one of the provided options.
Example