Open jimmywarting opened 3 years ago
I do agree that the use of this node package is diminishing, I would like to note that the implementation of TextEncoder
is still experimental, and requires a polyfill for IE.
Further, this package does a string check, which can be useful for when a number gets passed in instead.
webidl have stuff that makes sure everything you pass to encode()
is transformed into a string first by doing more magic than just String(obj)
you can pass in boolean, numbers, null, whatever...
and IE is pretty much dead now... think it would just be better to conditionally load in a pollyfill if TextEncoder isn't available
https://github.com/nothingrandom/u8array/blob/178cb30e1fde5474d05b61079b42172d61a6f75a/index.js#L1-L18
Can all be replaced by this:
Would discourage use of this package and instead encourage ppl to use TextEncoder instead