flattenEntries function presentation
Last updated: 2026-03-04T23:21:38.427Z
Metrics
LOC: 15
Complexity: 5
Params: 2
Signature
flattenEntries(
entries: SelectEntry[],
): : Array<SelectOption & { groupLabel?: string }>
Source Code
function flattenEntries(
entries: SelectEntry[],
): Array<SelectOption & { groupLabel?: string }> {
const result: Array<SelectOption & { groupLabel?: string }> = [];
for (const entry of entries) {
if (isGroup(entry)) {
for (const o of entry.options) {
result.push({ ...o, groupLabel: entry.groupLabel });
}
} else {
result.push(entry);
}
}
return result;
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| isGroup | calls |
No incoming dependencies.