main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
307 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import isFinite from '../../isFinite';
|
---|
| 2 | var 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 | };
|
---|
| 11 | export default truncPonyfill; |
---|
Note:
See
TracBrowser
for help on using the repository browser.