Download frontend/src/utility-functions/math.ts from openfree/graphite2: direct link, hf CLI and curl.
- Browser
- Download file 112 Bytes
-
https://huggingface.co/spaces/openfree/graphite2/resolve/main/frontend/src/utility-functions/math.ts
- Command line
-
hf download hf://spaces/openfree/graphite2/frontend/src/utility-functions/math.ts
-
curl -L -o math.ts https://huggingface.co/spaces/openfree/graphite2/resolve/main/frontend/src/utility-functions/math.ts
112 Bytes
| export function clamp(value: number, min = 0, max = 1): number { | |
| return Math.max(min, Math.min(value, max)); | |
| } | |