(value: T)
| 4 | private lastItem: QueueItem<T> | null = null |
| 5 | |
| 6 | add(value: T) { |
| 7 | if (!this.existsMap.has(value)) { |
| 8 | this.existsMap.set(value, true) |
| 9 | const item = { |
| 10 | current: value, |
| 11 | next: null, |
| 12 | } |
| 13 | if (!this.firstItem) { |
| 14 | this.firstItem = item |
| 15 | } |
| 16 | if (this.lastItem) { |
| 17 | this.lastItem.next = item |
| 18 | } |
| 19 | this.lastItem = item |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | shift(): T | null { |
| 24 | if (this.firstItem) { |
no test coverage detected