source: node_modules/ramda-adjunct/es/internal/ponyfills/Math.trunc.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 307 bytes
Line 
1import isFinite from '../../isFinite';
2var truncPonyfill = function truncPonyfill(v) {
3 var numV = Number(v);
4 if (!isFinite(numV)) {
5 return numV;
6 }
7
8 // eslint-disable-next-line no-nested-ternary
9 return numV - numV % 1 || (numV < 0 ? -0 : numV === 0 ? numV : 0);
10};
11export default truncPonyfill;
Note: See TracBrowser for help on using the repository browser.