toInteger = function toInteger(value) {
  if (!value) {
    return 0;
  } // Coerce to number


  value = +value;

  if (value === INFINITY || value === -INFINITY) {
    var sign = value < 0 ? -1 : 1;
    return sign * MAX_INTEGER;
  }

  var remainder = value % 1;
  return value === value ? remainder ? value - remainder : value : 0; // eslint-disable-line
}
Utility methods used by JSData.

@example
import { utils } from 'js-data';
console.log(utils.isString('foo')); // true

@namespace utils
@type {Object}