(items: Array<T>, item: T, max = 0)
| 427 | } |
| 428 | |
| 429 | export function addToStart<T>(items: Array<T>, item: T, max = 0): Array<T> { |
| 430 | const newItems = [item, ...items] |
| 431 | return max && newItems.length > max ? newItems.slice(0, -1) : newItems |
| 432 | } |
| 433 | |
| 434 | export const skipToken = Symbol() |
| 435 | export type SkipToken = typeof skipToken |