(items: Array<T>, item: T, max = 0)
| 436 | } |
| 437 | |
| 438 | export function addToStart<T>(items: Array<T>, item: T, max = 0): Array<T> { |
| 439 | const newItems = [item, ...items] |
| 440 | return max && newItems.length > max ? newItems.slice(0, -1) : newItems |
| 441 | } |
| 442 | |
| 443 | export const skipToken = Symbol() |
| 444 | export type SkipToken = typeof skipToken |