MCPcopy Create free account
hub / github.com/MirrowApp/mirrow / parseDepth

Function parseDepth

packages/cli/src/cli.ts:18–30  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

16const corePkg = corePackage;
17
18function parseDepth(raw: string): number | typeof Infinity {
19 if (raw === "unbound") {
20 return Infinity;
21 }
22
23 const value = Number.parseInt(raw, 10);
24 if (!Number.isInteger(value) || value < 0) {
25 throw new InvalidArgumentError(
26 "Depth must be a non-negative integer or 'unbound'"
27 );
28 }
29 return value;
30}
31
32export async function runCli(argv: string[]): Promise<void> {
33 const program = new Command();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected