Skip to content

Commit

Permalink
Allow for clip(val, min) to mean clip(val, min, val). Useful for e.g.…
Browse files Browse the repository at this point in the history
… clip(val, 0)
  • Loading branch information
marcuswestin committed Jun 12, 2013
1 parent 54f9a37 commit 0ce7043
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clip.js
@@ -1,3 +1,3 @@
module.exports = function clip(val, min, max) { module.exports = function clip(val, min, max) {
return Math.max(Math.min(val, max), min) return Math.max(Math.min(val, max || val), min)
} }

0 comments on commit 0ce7043

Please sign in to comment.