This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

18 lines
356 B
JavaScript
Raw Normal View History

2021-04-02 02:24:13 +03:00
function allocUnsafe (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number')
}
if (size < 0) {
throw new RangeError('"size" argument must not be negative')
}
if (Buffer.allocUnsafe) {
return Buffer.allocUnsafe(size)
} else {
return new Buffer(size)
}
}
module.exports = allocUnsafe