Skip to content

Commit 2dbf741

Browse files
ChALkeRmysticatea
authored andcommitted
Breaking: deprecate safe-buffer.Buffer calls (#110)
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.
1 parent 5260039 commit 2dbf741

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/util/deprecated-apis.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,7 @@ module.exports = {
417417
},
418418
},
419419
}
420+
421+
// safe-buffer.Buffer function/constructror is just a re-export of buffer.Buffer
422+
// and should be deprecated likewise.
423+
module.exports.modules["safe-buffer"] = module.exports.modules.buffer

0 commit comments

Comments
 (0)