MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / clamp01

Function clamp01

src/interaction/findNearestPoint.ts:42–42  ·  view source on GitHub ↗
(v: number)

Source from the content-addressed store, hash-verified

40}
41
42const clamp01 = (v: number): number => Math.min(1, Math.max(0, v));
43
44const parsePercent = (value: string): number | null => {
45 const m = value.trim().match(/^(\d+(?:\.\d+)?)%$/);

Callers 1

computeBarLayoutPxFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected