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.

coerce.js 255B

1234567891011
  1. "use strict";
  2. var coerceToFinite = require("../finite/coerce");
  3. var abs = Math.abs, floor = Math.floor;
  4. module.exports = function (value) {
  5. value = coerceToFinite(value);
  6. if (!value) return value;
  7. return (value > 0 ? 1 : -1) * floor(abs(value));
  8. };