( input: string, output: Uint8Array, offset: number, )
| 188 | } |
| 189 | |
| 190 | function encodeString( |
| 191 | input: string, |
| 192 | output: Uint8Array, |
| 193 | offset: number, |
| 194 | ): number { |
| 195 | const length = new TextEncoder() |
| 196 | .encodeInto(input, output.subarray(offset)).written; |
| 197 | output.set( |
| 198 | output.subarray(offset, offset + length), |
| 199 | offset + calcHeaderSize(length), |
| 200 | ); |
| 201 | return encodeHeader(0b011_00000, length, output, offset) + length; |
| 202 | } |
| 203 | |
| 204 | function encodeArray( |
| 205 | input: CborType[], |
no test coverage detected