@exodus/bytes 1.0.0-rc.8 → 1.0.0-rc.9

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.
@@ -4,6 +4,7 @@ import {
4
4
  nativeDecoderLatin1,
5
5
  nativeBuffer,
6
6
  isHermes,
7
+ isDeno,
7
8
  } from './_utils.js'
8
9
 
9
10
  // See http://stackoverflow.com/a/22747272/680742, which says that lowest limit is in Chrome, with 0xffff args
@@ -64,7 +65,7 @@ export function decodeLatin1(arr, start = 0, stop = arr.length) {
64
65
  export const decodeAscii = nativeBuffer
65
66
  ? (a) =>
66
67
  // Buffer is faster on Node.js (but only for long enough data), if we know that output is ascii
67
- a.byteLength >= 0x3_00
68
+ a.byteLength >= 0x3_00 && !isDeno
68
69
  ? nativeBuffer.from(a.buffer, a.byteOffset, a.byteLength).latin1Slice(0, a.byteLength) // .latin1Slice is faster than .asciiSlice
69
70
  : nativeDecoder.decode(a) // On Node.js, utf8 decoder is faster than latin1
70
71
  : nativeDecoderLatin1
@@ -0,0 +1 @@
1
+ module.exports = () => require('./multi-byte.encodings.json') // lazy-load