blob: 93af51b26c29072de5b1ab5fc879566390c7c0ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
/* eslint-disable node/no-deprecated-api */
module.exports = function (size) {
if (typeof Buffer.allocUnsafe === 'function') {
try {
return Buffer.allocUnsafe(size)
} catch (e) {
return new Buffer(size)
}
}
return new Buffer(size)
}
|