packages/victory-core/src/victory-util/axis.js
function findAxisComponents(childComponents, predicate) {
  predicate = predicate || identity;
  const findAxes = (children) => {
    return children.reduce((memo, child) => {
      if (child.type && child.type.role === "axis" && predicate(child)) {
        return memo.concat(child);
      } else if (child.props && child.props.children) {
        return memo.concat(findAxes(React.Children.toArray(child.props.children)));
      }
      return memo;
    }, []);
  };

  return findAxes(childComponents);
}
function findAxisComponents(childComponents, predicate) {
  predicate = predicate || identity;
  const findAxes = (children) => {
    return children.reduce((memo, child) => {
      if (child.type && child.type.role === "axis" && predicate(child)) {
        return memo.concat(child);
      } else if (child.props && child.props.children) {
        return memo.concat(findAxes(React.Children.toArray(child.props.children)));
      }
      return memo;
    }, []);
  };

  return findAxes(childComponents);
}
function findAxisComponents ( childComponents , predicate ) { predicate = predicate || identity ; const findAxes = ( children ) => { return children . reduce ( ( memo , child ) => { if ( child . type && child . type . role === "axis" && predicate ( child ) ) { return memo . concat ( child ) ; } else if ( child . props && child . props . children ) { return memo . concat ( findAxes ( React . Children . toArray ( child . props . children ) ) ) ; } return memo ; } , [ ] ) ; } ; return findAxes ( childComponents ) ; }
Returns all axis components that pass a given predicate
@param {Array} childComponents: an array of children
@param {Function} predicate: a predicate function that will be called with each
@returns {Array} all axis components that pass the given predicate or []
Returns all axis components that pass a given predicate