This repository has been archived on 2020-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
|
'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)
|
|
}
|