shim.js 313 B

12345678910111213
  1. "use strict";
  2. var floor = Math.floor;
  3. module.exports = function (value) {
  4. if (isNaN(value)) return NaN;
  5. value = Number(value);
  6. if (value === 0) return value;
  7. if (value === Infinity) return Infinity;
  8. if (value === -Infinity) return -Infinity;
  9. if (value > 0) return floor(value);
  10. return -floor(-value);
  11. };