The close() method of the WritableStreamDefaultWriter interface closes the associated writable stream.
close()
MDN Reference