12 lines
276 B
JavaScript
Executable file
12 lines
276 B
JavaScript
Executable file
'use strict'
|
|
/* 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)
|
|
}
|