clip.js 92 Bytes Raw Blame History Permalink 1 2 3 module.exports = function clip(val, min, max) { return Math.max(Math.min(val, max), min) }