(value: CborType)
| 36 | * @returns A {@link Uint8Array} representing the encoded data. |
| 37 | */ |
| 38 | export function encodeCbor(value: CborType): Uint8Array { |
| 39 | const output = new Uint8Array(calcEncodingSize(value)); |
| 40 | const o = encode(value, output, 0); |
| 41 | if (o !== output.length) return output.subarray(0, o); |
| 42 | return output; |
| 43 | } |
no test coverage detected