mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 22:28:28 +00:00
10 lines
203 B
TypeScript
10 lines
203 B
TypeScript
import { z } from "zod";
|
|
|
|
export const BoolEnv = z.preprocess((val) => {
|
|
if (typeof val !== "string") {
|
|
return val;
|
|
}
|
|
|
|
return ["true", "1"].includes(val.toLowerCase().trim());
|
|
}, z.boolean());
|