endOfStream

fun endOfStream(error: EndOfStreamError = definedExternally)(source)

MDN Reference