Skip to content

Commit

Permalink
Make SafeBuffer's prototype inherit from Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 authored Oct 21, 2018
1 parent 649435c commit 4a4f75d
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 4a4f75d

Please # to comment.