(
denyInnerIndefinite: boolean,
message?: string,
)
| 180 | } |
| 181 | |
| 182 | async *#readIndefinite( |
| 183 | denyInnerIndefinite: boolean, |
| 184 | message?: string, |
| 185 | ): AsyncGenerator<CborStreamOutput> { |
| 186 | while (true) { |
| 187 | const byte = arrayToNumber( |
| 188 | (await this.#read(1, true)).buffer, |
| 189 | true, |
| 190 | ) as number; |
| 191 | if (byte === 0b111_11111) break; |
| 192 | if (denyInnerIndefinite && (byte & 0b000_11111) === 31) { |
| 193 | throw new TypeError(message); |
| 194 | } |
| 195 | const x = await this.#decode(byte); |
| 196 | if (x instanceof Array) { |
| 197 | yield x[0]; |
| 198 | await x[1]; |
| 199 | } else yield x; |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | async *#decodeSequence(): AsyncGenerator<CborStreamOutput> { |
| 204 | while (true) { |
no test coverage detected