create_buffer.js 244 B

123456789
  1. import { Buffer } from 'buffer';
  2. const createBuffer =
  3. Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow
  4. ? Buffer.from
  5. : // support for Node < 5.10
  6. val => new Buffer(val);
  7. export default createBuffer;