import { z } from "zod";
const booleanFromString = z.preprocess((val) => {
if (typeof val !== "string") return val;
return ["true", "1", "yes", "on"].includes(val.toLowerCase());
}, z.boolean());
use std::env;
fn main() {
let port: u16 = env::var("PORT")
.unwrap_or_else(|_| "8080".to_string())
.parse()
import { z } from "zod";
const booleanFromString = z
.string()
.transform((v) => v.trim().toLowerCase())
.pipe(z.enum(["true", "false", "1", "0"]))