MCPcopy Create free account
hub / github.com/middleapi/orpc / splitInHalf

Function splitInHalf

packages/shared/src/array.ts:5–8  ·  view source on GitHub ↗
(arr: readonly T[])

Source from the content-addressed store, hash-verified

3}
4
5export function splitInHalf<T>(arr: readonly T[]): [T[], T[]] {
6 const half = Math.ceil(arr.length / 2)
7 return [arr.slice(0, half), arr.slice(half)]
8}

Callers 2

#executeBatchMethod · 0.90
array.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected