packages/devtools-reps/src/reps/grip.js
function getPropIndexes(properties, max, filter) {
  const indexes = [];

  try {
    let i = 0;
    for (const name in properties) {
      if (indexes.length >= max) {
        return indexes;
      }

      // Type is specified in grip's "class" field and for primitive
      // values use typeof.
      const value = getPropValue(properties[name]);
      let type = value.class || typeof value;
      type = type.toLowerCase();

      if (filter(type, value, name)) {
        indexes.push(i);
      }
      i++;
    }
  } catch (err) {
    console.error(err);
  }
  return indexes;
}
function getPropIndexes(properties, max, filter) {
  const indexes = [];

  try {
    let i = 0;
    for (const name in properties) {
      if (indexes.length >= max) {
        return indexes;
      }

      // Type is specified in grip's "class" field and for primitive
      // values use typeof.
      const value = getPropValue(properties[name]);
      let type = value.class || typeof value;
      type = type.toLowerCase();

      if (filter(type, value, name)) {
        indexes.push(i);
      }
      i++;
    }
  } catch (err) {
    console.error(err);
  }
  return indexes;
}
function getPropIndexes ( properties , max , filter ) { const indexes = [ ] ; try { let i = 0 ; for ( const name in properties ) { if ( indexes . length >= max ) { return indexes ; } // Type is specified in grip's "class" field and for primitive // values use typeof. const value = getPropValue ( properties [ name ] ) ; let type = value . class || typeof value ; type = type . toLowerCase ( ) ; if ( filter ( type , value , name ) ) { indexes . push ( i ) ; } i ++ ; } } catch ( err ) { console . error ( err ) ; } return indexes ; }
Get the indexes of props in the object.

@param {Object} properties Props object.
@param {Number} max The maximum length of indexes array.
@param {Function} filter Filter the props you want.
@return {Array} Indexes of interesting props in the object.
Get the indexes of props in the object .