( input: Map<CborType, CborType>, output: Uint8Array, offset: number, )
| 255 | } |
| 256 | |
| 257 | function encodeMap( |
| 258 | input: Map<CborType, CborType>, |
| 259 | output: Uint8Array, |
| 260 | offset: number, |
| 261 | ): number { |
| 262 | // Tag Number 259 = [217, 1, 3] |
| 263 | output[offset++] = 217; |
| 264 | output[offset++] = 1; |
| 265 | output[offset++] = 3; |
| 266 | offset = encodeHeader(0b101_00000, input.size, output, offset); |
| 267 | for (const pair of input) { |
| 268 | offset = encode(pair[0], output, offset); |
| 269 | offset = encode(pair[1], output, offset); |
| 270 | } |
| 271 | return offset; |
| 272 | } |
no test coverage detected