MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / parseDuration

Function parseDuration

src/cli/commands/pomodoroCommand.ts:35–46  ·  view source on GitHub ↗
(value?: string)

Source from the content-addressed store, hash-verified

33}
34
35function parseDuration(value?: string): number | undefined {
36 if (!value) {
37 return undefined;
38 }
39
40 const parsed = Number(value);
41 if (!Number.isFinite(parsed) || parsed <= 0) {
42 throw new Error("--duration must be a positive number of minutes");
43 }
44
45 return parsed;
46}
47
48function hasTaskLookup(params: CliData): boolean {
49 return Boolean(params.path || params.title || params.query);

Callers 1

handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected