@exodus/bytes 1.14.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fallback/encoding.js +2 -1
- package/package.json +1 -1
package/fallback/encoding.js
CHANGED
|
@@ -211,7 +211,8 @@ export class TextEncoder {
|
|
|
211
211
|
encode(str = '') {
|
|
212
212
|
if (typeof str !== 'string') str = `${str}`
|
|
213
213
|
const res = utf8fromStringLoose(str)
|
|
214
|
-
|
|
214
|
+
// match new Uint8Array (per spec), which is non-pooled
|
|
215
|
+
return res.byteOffset === 0 && res.length === res.buffer.byteLength ? res : res.slice(0)
|
|
215
216
|
}
|
|
216
217
|
|
|
217
218
|
encodeInto(str, target) {
|