From: Feross Aboukhadijeh Date: Sun, 18 Feb 2018 01:17:09 +0000 (-0800) Subject: standard X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=5a7ac12357ebde98a35e946f19a1ba792d22b018;p=buffer.git standard --- diff --git a/index.js b/index.js index e806fe2..fa57ec4 100644 --- a/index.js +++ b/index.js @@ -692,7 +692,7 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } - byteOffset = +byteOffset // Coerce to Number. + byteOffset = +byteOffset // Coerce to Number. if (numberIsNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) @@ -944,8 +944,8 @@ function utf8Slice (buf, start, end) { var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 + : (firstByte > 0xBF) ? 2 + : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint