Last change
on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
276 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict'
|
---|
| 2 | /* eslint-disable node/no-deprecated-api */
|
---|
| 3 | module.exports = function (size) {
|
---|
| 4 | if (typeof Buffer.allocUnsafe === 'function') {
|
---|
| 5 | try {
|
---|
| 6 | return Buffer.allocUnsafe(size)
|
---|
| 7 | } catch (e) {
|
---|
| 8 | return new Buffer(size)
|
---|
| 9 | }
|
---|
| 10 | }
|
---|
| 11 | return new Buffer(size)
|
---|
| 12 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.