build/lib/buffer-utils.js
function toArrayBuffer(buf) {
  if (buf instanceof ArrayBuffer) {
    return buf;
  } else if (Buffer.isBuffer(buf)) {
    return bufferToArrayBuffer(buf);
  } else if (buf instanceof Uint8Array) {
    return bufferToArrayBuffer(buf);
  } else {
    return buf; // type unknown, trust the user
  }
}
function toArrayBuffer(buf) {
  if (buf instanceof ArrayBuffer) {
    return buf;
  } else if (Buffer.isBuffer(buf)) {
    return bufferToArrayBuffer(buf);
  } else if (buf instanceof Uint8Array) {
    return bufferToArrayBuffer(buf);
  } else {
    return buf; // type unknown, trust the user
  }
}
function toArrayBuffer ( buf ) { if ( buf instanceof ArrayBuffer ) { return buf ; } else if ( Buffer . isBuffer ( buf ) ) { return bufferToArrayBuffer ( buf ) ; } else if ( buf instanceof Uint8Array ) { return bufferToArrayBuffer ( buf ) ; } else { return buf ; // type unknown, trust the user } }
Converts any buffer to ArrayBuffer
@param {Buffer|ArrayBuffer|Uint8Array} buf Input buffer
@returns {ArrayBuffer}
Converts any buffer to ArrayBuffer