()
| 8 | export type PoolFunctions = [(reuse: 0 | 1) => Id, (id: Id) => void]; |
| 9 | |
| 10 | export const getPoolFunctions = (): PoolFunctions => { |
| 11 | const pool: Ids = []; |
| 12 | let nextId = 0; |
| 13 | return [ |
| 14 | (reuse: 0 | 1): Id => |
| 15 | (reuse ? arrayShift(pool) : null) ?? EMPTY_STRING + nextId++, |
| 16 | (id: Id): void => { |
| 17 | if (test(INTEGER, id) && size(pool) < 1e3) { |
| 18 | arrayPush(pool, id); |
| 19 | } |
| 20 | }, |
| 21 | ]; |
| 22 | }; |
no test coverage detected
searching dependent graphs…