(input: T[])
| 183 | }[keyof T] |
| 184 | |
| 185 | export function dedupeArrayById<T extends {id: unknown}>(input: T[]): T[] { |
| 186 | const ids = new Set<unknown>() |
| 187 | const deduped: T[] = [] |
| 188 | for (let i = input.length - 1; i >= 0; i--) { |
| 189 | const update = input[i]! |
| 190 | if (ids.has(update.id)) continue |
| 191 | ids.add(update.id) |
| 192 | deduped.push(update) |
| 193 | } |
| 194 | return deduped |
| 195 | } |
| 196 | |
| 197 | export function mutate_filter<T>(array: T[], callback: (item: T) => boolean): void { |
| 198 | for (let i = array.length - 1; i >= 0; i--) { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…