Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

isNonNegativeInteger.js 551B

1234567891011121314151617
  1. 'use strict';
  2. // TODO: We need this polyfill because of the support of Node 10.
  3. // When we will drop Node 10, please remove this polyfill.
  4. // See <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger>
  5. const isInteger =
  6. Number.isInteger ||
  7. function (value) {
  8. return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
  9. };
  10. /**
  11. * @param {unknown} value
  12. */
  13. module.exports = function (value) {
  14. return isInteger(value) && typeof value === 'number' && value >= 0;
  15. };