import type { PropChildren, PropSingleChild } from '@/utils/types'; /** * Expose prop children as the original value when only one child exists. * Falls back to the original array (or undefined) in every other case. */ export const unwrapChildren = ( children: PropChildren | undefined ): PropSingleChild | PropChildren | undefined => { if (!children || children.length === 0) { return undefined; } return children.length === 1 ? children[0] : children; };