structured-headers icon indicating copy to clipboard operation
structured-headers copied to clipboard

Add `toString` as an alias to `toBase64` for ByteSequence

Open CxRes opened this issue 1 year ago • 1 comments

I am trying to write a comparator for Items. The simplest thing will be match the type and compare the values. Amongst the non-primitive types, I cannot coerce only ByteSequence to a string using toString but have to use toBase64 instead. Adding toString as an alias will fix this!

CxRes avatar Mar 18 '24 15:03 CxRes

I considered this, but given that ByteSequence is somewhat similar to Node's Buffer and JS's TypedArray family, it didn't feel good to add toString().

However, given that UInt8Array is widely available now I think a future version should probably ditch ByteSequence altogether and switch to it.

evert avatar Mar 20 '24 01:03 evert