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

Function normalizeChildren

packages/plugins/src/index.ts:345–353  ·  view source on GitHub ↗
(
  children?: (DevComponent | string)[] | DevComponent | string
)

Source from the content-addressed store, hash-verified

343}
344
345function normalizeChildren(
346 children?: (DevComponent | string)[] | DevComponent | string
347): (DevComponent | string)[] {
348 if (children === undefined) {
349 return []
350 }
351
352 return Array.isArray(children) ? children : [children]
353}
354
355/**
356 * Hyperscript helper to compose `DevComponent` trees from plugin code.

Callers 1

hFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected