MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / findChild

Function findChild

packages/plugins/src/index.ts:490–495  ·  view source on GitHub ↗
(
  node: ContainerNode,
  query: NodeQuery
)

Source from the content-addressed store, hash-verified

488 * ```
489 */
490export function findChild<T extends DesignNode = DesignNode>(
491 node: ContainerNode,
492 query: NodeQuery
493): T | null {
494 return (node.children.find((child) => matchNode(child, query)) as T) ?? null
495}
496
497/**
498 * Find all direct children that match the query.

Callers 2

index.test.tsFile · 0.90
queryAllFunction · 0.85

Calls 1

matchNodeFunction · 0.85

Tested by

no test coverage detected