()
| 99 | } |
| 100 | |
| 101 | public shift(): V | undefined { |
| 102 | if (!this._head && !this._tail) { |
| 103 | return undefined; |
| 104 | } |
| 105 | if (!this._head || !this._tail) { |
| 106 | throw new Error('Invalid list'); |
| 107 | } |
| 108 | const item = this._head; |
| 109 | this._map.delete(item.key); |
| 110 | this.removeItem(item); |
| 111 | this._size--; |
| 112 | return item.value; |
| 113 | } |
| 114 | |
| 115 | public forEach(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void { |
| 116 | let current = this._head; |
no test coverage detected