function readableStreamClose (controller) {
  try {
    controller.close()
  } catch (err) {
    // TODO: add comment explaining why this error occurs.
    if (!err.message.includes('Controller is already closed')) {
      throw err
    }
  }
}
@see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
@see https://streams.spec.whatwg.org/#read-loop
@param {ReadableStreamDefaultReader} reader