Math them all.

This commit is contained in:
Michał Lipiński
2017-04-04 22:38:50 +02:00
parent bbd59f800b
commit 2538a56577
11 changed files with 14 additions and 52 deletions

View File

@@ -1,7 +1,3 @@
/* Built-in method references for those with the same name as other `lodash` methods. */
const nativeMax = Math.max
const nativeMin = Math.min
/**
* The base implementation of `inRange` which doesn't coerce arguments.
*
@@ -12,7 +8,7 @@ const nativeMin = Math.min
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
*/
function baseInRange(number, start, end) {
return number >= nativeMin(start, end) && number < nativeMax(start, end)
return number >= Math.min(start, end) && number < Math.max(start, end)
}
export default baseInRange