MCPcopy
hub / github.com/prisma/prisma / flatten

Function flatten

helpers/blaze/flatten.ts:19–21  ·  view source on GitHub ↗

* Returns a new array with all sub-array elements concatenated. * (more efficient than native flat) * * @param list * @returns

(list: T & L.List<I>)

Source from the content-addressed store, hash-verified

17 * @returns
18 */
19function flatten<T extends L.List, I>(list: T & L.List<I>): Flatten<T> {
20 return reduce(list, (acc, item) => concat(acc, wrap(item)), [] as any[])
21}
22
23type Flatten<L extends L.List, I = L[number]> = (I extends L.List ? I[number] : I)[]
24

Callers 1

createBuildOptionsFunction · 0.90

Calls 3

reduceFunction · 0.90
concatFunction · 0.90
wrapFunction · 0.70

Tested by

no test coverage detected