_baseInRange.js 612 B

12345678910111213141516171819
  1. /* Built-in method references for those with the same name as other `lodash` methods. */
  2. var nativeMax = Math.max,
  3. nativeMin = Math.min;
  4. /**
  5. * The base implementation of `_.inRange` which doesn't coerce arguments.
  6. *
  7. * @private
  8. * @param {number} number The number to check.
  9. * @param {number} start The start of the range.
  10. * @param {number} end The end of the range.
  11. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  12. */
  13. function baseInRange(number, start, end) {
  14. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  15. }
  16. module.exports = baseInRange;