When the input for a ZIP entry is a string, it is currently transformed into a Uint8Array, even for large strings. When the browser supports TextEncoderStream , we should use that and set the entry's internal bytes to the resulting stream instead of a Uint8Array.
Uint8Array streams (the readable half of a TextEncoderStream) are already a valid internal type, so only input normalization is impacted by this change.
Sadly, that feature is not yet implemented in Safari, so it needs to be an optional code path with feature detection.
I don't expect this change to be massively useful in the long term (since using large strings as input is a bad idea anyway) but it should be simple.
When the input for a ZIP entry is a string, it is currently transformed into a Uint8Array, even for large strings. When the browser supports TextEncoderStream , we should use that and set the entry's internal
bytes
to the resulting stream instead of a Uint8Array.Uint8Array streams (the readable half of a TextEncoderStream) are already a valid internal type, so only input normalization is impacted by this change.
Sadly, that feature is not yet implemented in Safari, so it needs to be an optional code path with feature detection.
I don't expect this change to be massively useful in the long term (since using large strings as input is a bad idea anyway) but it should be simple.