function toArrayBuffer(buf) {
  if (buf.byteLength === buf.buffer.byteLength) {
    return buf.buffer;
  }

  return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
}
function toArrayBuffer(buf) {
  if (buf.byteLength === buf.buffer.byteLength) {
    return buf.buffer;
  }

  return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
}
function toArrayBuffer ( buf ) { if ( buf . byteLength === buf . buffer . byteLength ) { return buf . buffer ; } return buf . buffer . slice ( buf . byteOffset , buf . byteOffset + buf . byteLength ) ; }
Converts a buffer to an `ArrayBuffer`.

@param {Buffer} buf The buffer to convert
@return {ArrayBuffer} Converted buffer
@public
Converts a buffer to an ArrayBuffer .
Converts a buffer to an array of bytes