modules/core/src/utils/flatten.js
function flattenArray(array, filter, map, result) {
  let index = -1;
  while (++index < array.length) {
    const value = array[index];
    if (Array.isArray(value)) {
      flattenArray(value, filter, map, result);
    } else if (filter(value)) {
      result.push(map(value));
    }
  }
  return result;
}
function flattenArray(array, filter, map, result) {
  let index = -1;
  while (++index < array.length) {
    const value = array[index];
    if (Array.isArray(value)) {
      flattenArray(value, filter, map, result);
    } else if (filter(value)) {
      result.push(map(value));
    }
  }
  return result;
}
function flattenArray ( array , filter , map , result ) { let index = - 1 ; while ( ++ index < array . length ) { const value = array [ index ] ; if ( Array . isArray ( value ) ) { flattenArray ( value , filter , map , result ) ; } else if ( filter ( value ) ) { result . push ( map ( value ) ) ; } } return result ; }
Deep flattens an array. Helper to `flatten`, see its parameters
Deep flattens an array . Helper to flatten see its parameters