(source: Source)
| 656 | } |
| 657 | |
| 658 | async getHeader(source: Source): Promise<Header> { |
| 659 | const cacheKey = source.getKey(); |
| 660 | const cacheValue = this.cache.get(cacheKey); |
| 661 | if (cacheValue) { |
| 662 | cacheValue.lastUsed = this.counter++; |
| 663 | const data = cacheValue.data; |
| 664 | return data as Header; |
| 665 | } |
| 666 | |
| 667 | const res = await getHeaderAndRoot(source, this.decompress); |
| 668 | if (res[1]) { |
| 669 | this.cache.set(res[1][0], { |
| 670 | lastUsed: this.counter++, |
| 671 | data: res[1][2], |
| 672 | }); |
| 673 | } |
| 674 | |
| 675 | this.cache.set(cacheKey, { |
| 676 | lastUsed: this.counter++, |
| 677 | data: res[0], |
| 678 | }); |
| 679 | this.prune(); |
| 680 | return res[0]; |
| 681 | } |
| 682 | |
| 683 | async getDirectory( |
| 684 | source: Source, |
nothing calls this directly
no test coverage detected