We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3386939 commit 1bbb8d7Copy full SHA for 1bbb8d7
fallback/latin1.js
@@ -147,7 +147,8 @@ export function encodeAsciiPrefix(x, s) {
147
export const encodeLatin1 = (str) => encodeCharcodes(str, new Uint8Array(str.length))
148
149
// Expects nativeEncoder to be present
150
-export const encodeAscii = isHermes
+const useEncodeInto = isHermes && nativeEncoder.encodeInto
151
+export const encodeAscii = useEncodeInto
152
? (str, ERR) => {
153
// Much faster in Hermes
154
const codes = new Uint8Array(str.length + 4) // overshoot by a full utf8 char
0 commit comments