(items: Array<T>, item: T, max = 0)
| 398 | } |
| 399 | |
| 400 | export function addToEnd<T>(items: Array<T>, item: T, max = 0): Array<T> { |
| 401 | const newItems = [...items, item] |
| 402 | return max && newItems.length > max ? newItems.slice(1) : newItems |
| 403 | } |
| 404 | |
| 405 | export function addToStart<T>(items: Array<T>, item: T, max = 0): Array<T> { |
| 406 | const newItems = [item, ...items] |
no outgoing calls
no test coverage detected
searching dependent graphs…