zod-opts
Version:
node.js CLI option parser / validator using Zod
16 lines • 488 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const zod_1 = require("zod");
// import { parser } from "zod-opts";
const index_1 = require("../src/index");
const parsed = (0, index_1.parser)()
.options({
option1: {
type: zod_1.z.string().refine((v) => v === "foo" || v === "bar", {
message: "option1 must be foo or bar",
}),
},
})
.parse();
console.log(parsed);
//# sourceMappingURL=custom_validation_refine.js.map