MCPcopy Index your code
hub / github.com/garrytan/gstack / booleanFlag

Function booleanFlag

make-pdf/src/cli.ts:121–125  ·  view source on GitHub ↗
(key: string, def: boolean)

Source from the content-addressed store, hash-verified

119 }
120 const f = parsed.flags;
121 const booleanFlag = (key: string, def: boolean): boolean => {
122 if (f[key] === true) return true;
123 if (f[`no-${key}`] === true) return false;
124 return def;
125 };
126 const to = typeof f.to === "string" ? f.to.toLowerCase() : "pdf";
127 if (to !== "pdf" && to !== "html" && to !== "docx") {
128 console.error(`$P generate: invalid --to '${f.to}'. Expected pdf, html, or docx.`);

Callers 2

generateOptionsFromFlagsFunction · 0.85
previewOptionsFromFlagsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected