Front end of the Slack clone application.

index.js 356B

123456789101112131415161718
  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