Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ethanniser/the-beth-stack
/ deepFlatten
Function
deepFlatten
packages/beth-stack/src/jsx/utils.ts:303–307 ·
view source on GitHub ↗
(arr: (T | T[])[])
Source
from the content-addressed store, hash-verified
301
}
302
303
export
function
deepFlatten<T>(arr: (T | T[])[]): T[] {
304
return
arr.reduce<T[]>((acc, val) => {
305
return
Array.isArray(val) ? acc.concat(deepFlatten(val)) : acc.concat(val);
306
}, []);
307
}
Callers
1
createElement
Function · 0.90
Calls
no outgoing calls
Tested by
no test coverage detected