All files / src/helpers/number to_integer.js

66.66% Statements 4/6
50% Branches 2/4
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7    2x 3x 3x 3x  
import {MAX_SAFE_INTEGER} from "./const";
 
export const toInt = val => {
    Iif (val === Infinity) return MAX_SAFE_INTEGER;
    Iif (val === -Infinity) return -MAX_SAFE_INTEGER;
    return ~~val;
}