* Insert an item. * @param {Number} index * @param {Buffer} item * @returns {Buffer}
(index, item)
| 245 | */ |
| 246 | |
| 247 | insert(index, item) { |
| 248 | if (index < 0) |
| 249 | index += this.items.length; |
| 250 | |
| 251 | assert(Buffer.isBuffer(item)); |
| 252 | assert(index >= 0 && index <= this.items.length); |
| 253 | |
| 254 | this.items.splice(index, 0, item); |
| 255 | |
| 256 | return this; |
| 257 | } |
| 258 | |
| 259 | /** |
| 260 | * Erase stack items. |
no outgoing calls
no test coverage detected