You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 356B

1234567891011121314151617
  1. function allocUnsafe (size) {
  2. if (typeof size !== 'number') {
  3. throw new TypeError('"size" argument must be a number')
  4. }
  5. if (size < 0) {
  6. throw new RangeError('"size" argument must not be negative')
  7. }
  8. if (Buffer.allocUnsafe) {
  9. return Buffer.allocUnsafe(size)
  10. } else {
  11. return new Buffer(size)
  12. }
  13. }
  14. module.exports = allocUnsafe