code: function getEntriesIndexes(entries, max, filter) {
    return entries.reduce((indexes, [key, entry], i) => {
      if (indexes.length < max) {
        const value = entry && entry.value !== undefined ? entry.value : entry;
        // Type is specified in grip's "class" field and for primitive
        // values use typeof.
        const type = (value && value.class
          ? value.class
          : typeof value
        ).toLowerCase();
  
        if (filter(type, value, key)) {
          indexes.push(i);
        }
      }
  
      return indexes;
    }, []);
  }
docs: Get the indexes of entries in the map.
  
  @param {Array} entries Entries array.
  @param {Number} max The maximum length of indexes array.
  @param {Function} filter Filter the entry you want.
  @return {Array} Indexes of filtered entries in the map.