code: function toBuffer(data) {
    toBuffer.readOnly = true;
  
    if (Buffer.isBuffer(data)) return data;
  
    let buf;
  
    if (data instanceof ArrayBuffer) {
      buf = Buffer.from(data);
    } else if (ArrayBuffer.isView(data)) {
      buf = viewToBuffer(data);
    } else {
      buf = Buffer.from(data);
      toBuffer.readOnly = false;
    }
  
    return buf;
  }
docs: Converts `data` to a `Buffer`.
  
  @param {*} data The data to convert
  @return {Buffer} The buffer
  @throws {TypeError}
  @public