MCPcopy
hub / github.com/QwikDev/qwik / isChildComponent

Function isChildComponent

packages/qwik/src/core/render/dom/visitor.ts:329–348  ·  view source on GitHub ↗
(node: Node | VirtualElement)

Source from the content-addressed store, hash-verified

327};
328
329export const isChildComponent = (node: Node | VirtualElement): boolean => {
330 const type = node.nodeType;
331 if (type === 3 || type === 111) {
332 return true;
333 }
334 if (type !== 1) {
335 return false;
336 }
337 const nodeName = node.nodeName;
338 if (nodeName === 'Q:TEMPLATE') {
339 return false;
340 }
341 if (nodeName === 'HEAD') {
342 return (node as Element).hasAttribute('q:head');
343 }
344 if (nodeName === 'STYLE') {
345 return !(node as Element).hasAttribute(QStyle);
346 }
347 return true;
348};
349
350export const splitChildren = (input: ProcessedJSXNode[]): Record<string, ProcessedJSXNode> => {
351 const output: Record<string, ProcessedJSXNode> = {};

Callers

nothing calls this directly

Calls 1

hasAttributeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…