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

Function clamp01

src/tools/semantic-identifiers.ts:97–101  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

95}
96
97function clamp01(value: number): number {
98 if (value <= 0) return 0;
99 if (value >= 1) return 1;
100 return value;
101}
102
103function normalizeWeight(value: number | undefined, fallback: number): number {
104 if (value === undefined || !Number.isFinite(value) || value < 0) return fallback;

Callers 2

rankCallSitesFunction · 0.70
semanticIdentifierSearchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected