Skip to content

Commit

Permalink
Breaking: deprecate safe-buffer.Buffer calls (#110)
Browse files Browse the repository at this point in the history
safe-buffer.Buffer function/constructror is just a re-export of
buffer.Buffer and should be deprecated likewise.

Otherwise, using Buffer = require('safe-buffer').Buffer magically hides
the deprecation message, which it shouldn't, as that code will
actually cause runtime deprecation errors on Node.js >= 10.
  • Loading branch information
ChALkeR authored and mysticatea committed Mar 9, 2018
1 parent 5260039 commit 2dbf741
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/util/deprecated-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,7 @@ module.exports = {
},
},
}

// safe-buffer.Buffer function/constructror is just a re-export of buffer.Buffer
// and should be deprecated likewise.
module.exports.modules["safe-buffer"] = module.exports.modules.buffer

0 comments on commit 2dbf741

Please sign in to comment.