Skip to content

Commit

Permalink
Merge pull request #23 from vkarpov15/patch-1
Browse files Browse the repository at this point in the history
Make SafeBuffer's prototype inherit from Buffer
  • Loading branch information
feross committed Jul 5, 2019
2 parents 4463582 + 4a4f75d commit a43206b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function SafeBuffer (arg, encodingOrOffset, length) {
return Buffer(arg, encodingOrOffset, length)
}

SafeBuffer.prototype = Object.create(Buffer.prototype)

// Copy static methods from Buffer
copyProps(Buffer, SafeBuffer)

Expand Down

0 comments on commit a43206b

Please sign in to comment.