my-idlers/node_modules/es5-ext/number/to-integer.js
cp6 fd22b0bf58 V2 (Laravel re-make)
V2 (Laravel re-make)
2022-03-06 02:02:12 +11:00

13 lines
282 B
JavaScript
Vendored

"use strict";
var sign = require("../math/sign")
, abs = Math.abs
, floor = Math.floor;
module.exports = function (value) {
if (isNaN(value)) return 0;
value = Number(value);
if (value === 0 || !isFinite(value)) return value;
return sign(value) * floor(abs(value));
};