(url: string)
| 135 | constructor(private bundle: Bundle) {} |
| 136 | |
| 137 | getResponse(url: string): Response { |
| 138 | const indexEntry = asArray(this.bundle.indexSection.get(url)); |
| 139 | if (!indexEntry) { |
| 140 | throw new Error('No entry for ' + url); |
| 141 | } |
| 142 | const [variants, offset, length] = indexEntry; |
| 143 | if (asBytestring(variants).length !== 0) { |
| 144 | throw new Error('Variants are not supported'); |
| 145 | } |
| 146 | if (indexEntry.length !== 3) { |
| 147 | throw new Error('Unexpected length of index entry for ' + url); |
| 148 | } |
| 149 | const resp = this.bundle.responses[asNumber(offset)]; |
| 150 | if (!resp) { |
| 151 | throw new Error(`Response for ${url} is not found (broken index)`); |
| 152 | } |
| 153 | return resp; |
| 154 | } |
| 155 | |
| 156 | destructureBundle(wbn: unknown[]): [any, any, any, any, any, any] { |
| 157 | return [wbn[0], wbn[1], wbn[2], wbn[3], wbn[4], wbn[5]]; |
nothing calls this directly
no test coverage detected