structured-headers
structured-headers copied to clipboard
Add `toString` as an alias to `toBase64` for ByteSequence
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!
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.