You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
186 B
JavaScript
15 lines
186 B
JavaScript
7 years ago
|
/*global $*/
|
||
|
'use strict';
|
||
|
|
||
|
function constrain(input, min, max) {
|
||
|
|
||
|
if (input < min) {
|
||
|
return min;
|
||
|
}
|
||
|
|
||
|
if (input > max) {
|
||
|
return max;
|
||
|
}
|
||
|
|
||
|
return input;
|
||
|
}
|