UNPKG

antd-mobile

Version:
10 lines 208 B
export function bound(position, min, max) { let ret = position; if (min !== undefined) { ret = Math.max(position, min); } if (max !== undefined) { ret = Math.min(ret, max); } return ret; }