UNPKG

zod-opts

Version:

node.js CLI option parser / validator using Zod

19 lines 519 B
"use strict"; 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)() .args([ { name: "pos", type: zod_1.z.array(zod_1.z.string()).default([]), // optional arg. type is string[] }, ]) .parse(); // parsed is inferred as below: // const parsed: { // pos: string[]; // }; console.log(parsed); //# sourceMappingURL=array_optional.js.map