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

Function toIntegerOr

src/core/embeddings.ts:143–147  ·  view source on GitHub ↗
(value: string | undefined, fallback: number)

Source from the content-addressed store, hash-verified

141}
142
143function toIntegerOr(value: string | undefined, fallback: number): number {
144 if (!value) return fallback;
145 const parsed = Number.parseInt(value, 10);
146 return Number.isFinite(parsed) ? parsed : fallback;
147}
148
149function toOptionalInteger(value: string | undefined): number | undefined {
150 if (!value) return undefined;

Callers 2

getEmbeddingBatchSizeFunction · 0.70
getEmbedChunkCharsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected