UNPKG

ignore-case

Version:

A JavaScript micro library that provides case-insensitive string helpers

14 lines (12 loc) 234 B
'use strict'; module.exports = function toInteger(value) { if (!value) { return 0; } var val = +value; // Check if val is NaN if (val !== val) { return 0; } return val > 0 ? Math.floor(val) : Math.ceil(val); };