MCPcopy
hub / github.com/react-component/slider / getOffset

Function getOffset

src/util.ts:3–5  ·  view source on GitHub ↗
(value: number, min: number, max: number)

Source from the content-addressed store, hash-verified

1import type { Direction } from './interface';
2
3export function getOffset(value: number, min: number, max: number) {
4 return (value - min) / (max - min);
5}
6
7export function getDirectionStyle(direction: Direction, value: number, min: number, max: number) {
8 const offset = getOffset(value, min, max);

Callers 2

TrackFunction · 0.90
getDirectionStyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected