"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getValidChildren = getValidChildren;
var _element = require("@wordpress/element");
/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */

/**
 * Gets a collection of available children elements from a React component's children prop.
 *
 * @param children
 *
 * @return An array of available children.
 */
function getValidChildren(children) {
  if (typeof children === 'string') {
    return [children];
  }
  return _element.Children.toArray(children).filter(child => (0, _element.isValidElement)(child));
}
//# sourceMappingURL=get-valid-children.js.map