UNPKG

gather-content-ui

Version:
24 lines (23 loc) 690 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.childrenContainsComponent = exports.childIsComponent = void 0; var childIsComponent = exports.childIsComponent = function childIsComponent(child, func) { if (!child) { return false; } return child.type === func; }; var childrenContainsComponent = exports.childrenContainsComponent = function childrenContainsComponent(children, func) { if (!children || !func) { return false; } if (childIsComponent(children, func)) { return true; } return children.some && children.some(function (child) { return childIsComponent(child, func); }); }; //# sourceMappingURL=index.js.map