Latest
The Standard Library has been moved to JSR. See the blog post for details.
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.
import type { Writer } from "../io/types.ts";import { toWritableStream } from "../io/to_writable_stream.ts";
/** * Options for {@linkcode writableStreamFromWriter}. * * @deprecated This will be removed in 1.0.0. Use {@linkcode toWritableStream} instead. */export interface WritableStreamFromWriterOptions { /** * If the `writer` is also a `Closer`, automatically close the `writer` * when the stream is closed, aborted, or a write error occurs. * * @default {true} */ autoClose?: boolean;}
/** * Create a {@linkcode WritableStream} from a {@linkcode Writer}. * * @deprecated This will be removed in 1.0.0. Use {@linkcode toWritableStream} instead. */export function writableStreamFromWriter( writer: Writer, options: WritableStreamFromWriterOptions = {},): WritableStream<Uint8Array> { return toWritableStream(writer, options);}