code: function toArrayBuffer(buf) {
    if (buf.byteLength === buf.buffer.byteLength) {
      return buf.buffer;
    }
  
    return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  }
docs: Converts a buffer to an `ArrayBuffer`.
  
  @param {Buffer} buf The buffer to convert
  @return {ArrayBuffer} Converted buffer
  @public