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

Function clamp01

src/core/embeddings.ts:336–340  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

334}
335
336function clamp01(value: number): number {
337 if (value <= 0) return 0;
338 if (value >= 1) return 1;
339 return value;
340}
341
342function normalizeThreshold(value: number | undefined, fallback: number): number {
343 if (value === undefined || !Number.isFinite(value)) return fallback;

Callers 3

normalizeThresholdFunction · 0.70
computeKeywordScoreFunction · 0.70
computeCombinedScoreFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected