diff options
Diffstat (limited to 'node_modules/moment/src/lib/utils/to-int.js')
-rw-r--r-- | node_modules/moment/src/lib/utils/to-int.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/moment/src/lib/utils/to-int.js b/node_modules/moment/src/lib/utils/to-int.js new file mode 100644 index 0000000..fb48941 --- /dev/null +++ b/node_modules/moment/src/lib/utils/to-int.js @@ -0,0 +1,12 @@ +import absFloor from './abs-floor'; + +export default function toInt(argumentForCoercion) { + var coercedNumber = +argumentForCoercion, + value = 0; + + if (coercedNumber !== 0 && isFinite(coercedNumber)) { + value = absFloor(coercedNumber); + } + + return value; +} |