@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.
@@ -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
- return res.byteOffset === 0 ? res : res.slice(0) // Ensure 0-offset, to match new Uint8Array (per spec), which is non-pooled
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bytes",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "Various operations on Uint8Array data",
5
5
  "keywords": [
6
6
  "encoding",