A simple function to map some cursor to its position within a maximum.
yarn add map-cursor-to-max
import { mapCursorToMax } from "map-cursor-to-max";
mapCursorToMax(0, 10); // => 0
mapCursorToMax(1, 10); // => 1
mapCursorToMax(9, 10); // => 9
mapCursorToMax(10, 10); // => 0
mapCursorToMax(11, 10); // => 1
mapCursorToMax(-1, 10); // => 9
const mapCursorToMax: (cursor: number, max: number) => number;