MCPcopy
hub / github.com/GrapesJS/grapesjs / contains

Method contains

packages/core/src/dom_components/model/Component.ts:726–738  ·  view source on GitHub ↗

* The method returns a Boolean value indicating whether the passed * component is a descendant of a given component * @param {Component} component Component to check * @returns {Boolean}

(component: Component)

Source from the content-addressed store, hash-verified

724 * @returns {Boolean}
725 */
726 contains(component: Component) {
727 let result = !1;
728 if (!component) return result;
729 const contains = (components: Components) => {
730 !result &&
731 components.forEach((item) => {
732 if (item === component) result = !0;
733 !result && contains(item.components());
734 });
735 };
736 contains(this.components());
737 return result;
738 }
739
740 /**
741 * Once the tag is updated I have to rerender the element

Callers 7

SectorView.tsFile · 0.80
updateClientYMethod · 0.80
getOffsetFunction · 0.80
cash-dom.tsFile · 0.80
hasComponentMethod · 0.80

Calls 2

componentsMethod · 0.95
containsFunction · 0.50

Tested by

no test coverage detected