MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / clamp

Function clamp

apps/desktop/src/main/index.ts:768–770  ·  view source on GitHub ↗
(value: number, min: number, max: number)

Source from the content-addressed store, hash-verified

766}
767
768function clamp(value: number, min: number, max: number): number {
769 return Math.min(Math.max(value, min), max)
770}
771
772function normalizeZoomFactor(value: number): number {
773 return Math.round(clamp(value, MIN_ZOOM_FACTOR, MAX_ZOOM_FACTOR) * 100) / 100

Callers 2

normalizeZoomFactorFunction · 0.70
sanitizeWindowStateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected