just-clamp
Advanced tools
Comparing version 3.0.0 to 3.0.1
12
index.js
@@ -9,3 +9,3 @@ module.exports = clamp; | ||
clamp(0, n, 0); // 0 | ||
var n = -2; | ||
@@ -16,8 +16,8 @@ clamp(1, n, 12); // 1 | ||
clamp(NaN, n, 8); // NaN | ||
clamp(3, n, NaN); // NaN | ||
clamp(3, NaN, 8); // NaN | ||
clamp(3, n, NaN); // NaN | ||
clamp(3, NaN, 8); // NaN | ||
clamp(undefined, n, 8); // throws | ||
clamp(3, n, 'h'); // throws | ||
clamp(12, false, 8); // throws | ||
clamp(3, n, 'h'); // throws | ||
clamp(12, false, 8); // throws | ||
*/ | ||
@@ -29,3 +29,3 @@ | ||
} | ||
if (Number.isNaN(b1) || Number.isNaN(n) || Number.isNaN(b2)) { | ||
if (isNaN(b1) || isNaN(n) || isNaN(b2)) { | ||
return NaN; | ||
@@ -32,0 +32,0 @@ } |
{ | ||
"name": "just-clamp", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "restrict a number within a range", | ||
@@ -10,11 +10,3 @@ "main": "index.js", | ||
"repository": "https://github.com/angus-c/just", | ||
"keywords": [ | ||
"clamp", | ||
"restrict", | ||
"greater", | ||
"less", | ||
"range", | ||
"number", | ||
"just" | ||
], | ||
"keywords": ["clamp", "restrict", "greater", "less", "range", "number", "just"], | ||
"author": "Angus Croll", | ||
@@ -21,0 +13,0 @@ "license": "MIT", |
1824