export type ItemWithLabel = { label: string } export type ItemWithId = ItemWithLabel & { id: string } export function normalizeItemInput( item: TItem | string, ): TItem { if (typeof item === 'object') return item return { id: item, label: item, } as TItem } export function normalizeLabelItemInput( item: TItem | string, ): TItem { if (typeof item === 'object') return item return { label: item, } as TItem }