Describe the bug
Cbor.CBORType/CborStreamInput/etc doesn't allow ReadonlyArray. These should be allowed to encoders as CBOR encoding methods don't mutate their inputs.
Steps to Reproduce
import * as CBOR from "jsr:@std/cbor";
const arr: ReadonlyArray<number> = [1, 2, 3];
// Argument of type 'readonly number[]' is not assignable to parameter of type 'CborType'.
CBOR.encodeCbor(arr);
const encoder = new CBOR.CborSequenceEncoderStream();
const writer = encoder.getWriter();
// Argument of type 'readonly number[]' is not assignable to parameter of type 'CborStreamInput'.
writer.write(arr);
Expected behavior
These types should be accepted.
Actual behavior
We get a typescript typing error.
Environment
- OS: Ubuntu 26.04
- deno version: 2.8.1
- std version: 0.1.9
Describe the bug
Cbor.CBORType/CborStreamInput/etc doesn't allowReadonlyArray. These should be allowed to encoders as CBOR encoding methods don't mutate their inputs.Steps to Reproduce
Expected behavior
These types should be accepted.
Actual behavior
We get a typescript typing error.
Environment