isNumbery.js 331 B

12345678910111213
  1. 'use strict';
  2. /**
  3. * Check whether it's a number or a number-like string:
  4. * i.e. when coerced to a number it == itself.
  5. *
  6. * @param {string | number} value
  7. */
  8. module.exports = function (value) {
  9. /* eslint-disable eqeqeq */
  10. return value.toString().trim().length !== 0 && Number(value) == value;
  11. /* eslint-enable eqeqeq */
  12. };