(callback, thisArg)
| 337 | let offset = this.collectionLengthSize; |
| 338 | const self = this; |
| 339 | function readValues(callback, thisArg) { |
| 340 | for (let i = 0; i < totalItems; i++) { |
| 341 | const keyLength = self.decodeCollectionLength(bytes, offset); |
| 342 | offset += self.collectionLengthSize; |
| 343 | const key = self.decode(bytes.slice(offset, offset + keyLength), subtypes[0]); |
| 344 | offset += keyLength; |
| 345 | const valueLength = self.decodeCollectionLength(bytes, offset); |
| 346 | offset += self.collectionLengthSize; |
| 347 | if (valueLength < 0) { |
| 348 | callback.call(thisArg, key, null); |
| 349 | continue; |
| 350 | } |
| 351 | const value = self.decode(bytes.slice(offset, offset + valueLength), subtypes[1]); |
| 352 | offset += valueLength; |
| 353 | callback.call(thisArg, key, value); |
| 354 | } |
| 355 | } |
| 356 | if (this.encodingOptions.map) { |
| 357 | const mapConstructor = this.encodingOptions.map; |
| 358 | map = new mapConstructor(); |
no test coverage detected