From: Feross Aboukhadijeh Date: Wed, 21 Oct 2020 23:45:51 +0000 (-1000) Subject: standard X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=37c67934d05bbeeaf44d5a76f728e9ed704bb342;p=buffer.git standard --- diff --git a/index.js b/index.js index e87bfaa..c273272 100644 --- a/index.js +++ b/index.js @@ -947,10 +947,13 @@ function utf8Slice (buf, start, end) { while (i < end) { var firstByte = buf[i] var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 + var bytesPerSequence = (firstByte > 0xEF) + ? 4 + : (firstByte > 0xDF) + ? 3 + : (firstByte > 0xBF) + ? 2 + : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint