Skip to content

Commit

Permalink
Merge pull request #128 from feross/typeof
Browse files Browse the repository at this point in the history
Fix: Add missing "typeof"
  • Loading branch information
feross authored Aug 8, 2016
2 parents 60dd67a + d5cd2f2 commit ca9932a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,8 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
if (Buffer.TYPED_ARRAY_SUPPORT &&
typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
Expand Down

0 comments on commit ca9932a

Please sign in to comment.