reduxFilter = (node, parentArr, filter) => {
  if (node.name === undefined) return;
  const newObj = {
    name: node.name,
    children: [],
    id: node.id,
    props: node.props,
    state: node.state,
    methods: node.methods,
    isDOM: node.isDOM,
  };

  if (filter.includes(node.name) || node.name.includes('Connect')) {
    node.children.forEach((child) => {
      reduxFilter(child, parentArr, filter);
    });
  } else {
    parentArr.push(newObj);
    node.children.forEach((child) => {
      reduxFilter(child, newObj.children, filter);
    });
  }
}
This is specifically for redux, and looks for components names 'connect'