function cacheIndexOf(cache, value) {
    var type = typeof value;
    cache = cache.cache;

    if (type == 'boolean' || value == null) {
      return cache[value] ? 0 : -1;
    }
    if (type != 'number' && type != 'string') {
      type = 'object';
    }
    var key = type == 'number' ? value : keyPrefix + value;
    cache = (cache = cache[type]) && cache[key];

    return type == 'object'
      ? (cache && baseIndexOf(cache, value) > -1 ? 0 : -1)
      : (cache ? 0 : -1);
  }
An implementation of `_.contains` for cache objects that mimics the return
signature of `_.indexOf` by returning `0` if the value is found, else `-1`.

@private
@param {Object} cache The cache object to inspect.
@param {*} value The value to search for.
@returns {number} Returns `0` if `value` is found, else `-1`.