(item: Item<K, V>)
| 210 | } |
| 211 | |
| 212 | private addItemLast(item: Item<K, V>): void { |
| 213 | // First time Insert |
| 214 | if (!this._head && !this._tail) { |
| 215 | this._head = item; |
| 216 | } else if (!this._tail) { |
| 217 | throw new Error('Invalid list'); |
| 218 | } else { |
| 219 | item.previous = this._tail; |
| 220 | this._tail.next = item; |
| 221 | } |
| 222 | this._tail = item; |
| 223 | } |
| 224 | |
| 225 | private removeItem(item: Item<K, V>): void { |
| 226 | if (item === this._head && item === this._tail) { |