Fix optimization path for unicodeSlice

This commit is contained in:
trevor-signal
2026-03-16 13:21:35 -07:00
committed by GitHub
parent 8d6738127a
commit 4f3d25c4c5
2 changed files with 2 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ export function unicodeSlice(
end: number
): string {
// Optimization: whole string fits into the range, return as is
if (begin === 0 && end >= input.length) {
if (begin === 0 && end >= Buffer.byteLength(input)) {
return input;
}