Validation
Go beyond simple typing with custom validation logic.
const env = defineEnv({
API_KEY: {
type: "string",
validate: (val) => val.startsWith("pk_") || "Invalid Public Key format"
},
MAX_RETRIES: {
type: "number",
validate: (n) => n > 0 && n <= 10
}
});