function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) { return Math.max(min, Math.min(val, max)); } export default clamp;