MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / toIntegerOr

Function toIntegerOr

src/tools/semantic-search.ts:59–63  ·  view source on GitHub ↗
(value: string | undefined, fallback: number)

Source from the content-addressed store, hash-verified

57}
58
59function toIntegerOr(value: string | undefined, fallback: number): number {
60 if (!value) return fallback;
61 const parsed = Number.parseInt(value, 10);
62 return Number.isFinite(parsed) ? parsed : fallback;
63}
64
65function getMaxEmbedFileSize(): number {
66 return Math.max(1024, toIntegerOr(process.env.CONTEXTPLUS_MAX_EMBED_FILE_SIZE, DEFAULT_MAX_EMBED_FILE_SIZE));

Callers 1

getMaxEmbedFileSizeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected