MCPcopy Create free account
hub / github.com/cursor/plugins / parsePositiveInt

Function parsePositiveInt

continual-learning/hooks/continual-learning-stop.ts:37–46  ·  view source on GitHub ↗
(value: string | undefined, fallback: number)

Source from the content-addressed store, hash-verified

35}
36
37function parsePositiveInt(value: string | undefined, fallback: number): number {
38 if (!value) {
39 return fallback;
40 }
41 const parsed = Number.parseInt(value, 10);
42 if (!Number.isFinite(parsed) || parsed <= 0) {
43 return fallback;
44 }
45 return parsed;
46}
47
48function parseBoolean(value: string | undefined): boolean {
49 if (!value) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected