Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Buffer = require('buffer').Buffer
var isBuffer = require('is-buffer')

module.exports = function (buf) {
// If the buffer is backed by a Uint8Array, a faster version will work
Expand All @@ -12,7 +12,7 @@ module.exports = function (buf) {
}
}

if (Buffer.isBuffer(buf)) {
if (isBuffer(buf)) {
// This is the slow version that will work with any Buffer
// implementation (even in old browsers)
var arrayCopy = new Uint8Array(buf.length)
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
"devDependencies": {
"tape": "^4.4.0",
"zuul": "^3.9.0"
},
"dependencies": {
"is-buffer": "^1.1.1"
}
}