Fix optimization path for unicodeSlice

Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
automated-signal
2026-03-16 15:37:51 -05:00
committed by GitHub
parent f87188015e
commit fdfecdb5d9
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;
}