// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.
import { toWritableStream } from "jsr:/@std/io@^0.224.1/to-writable-stream";
/**
 * Create a {@linkcode WritableStream} from a {@linkcode https://jsr.io/@std/io/doc/types/~/Writer | Writer}.
 *
 * @param writer A `Writer` to convert into a `WritableStream`.
 * @param options Options for the `writableStreamFromWriter` function.
 * @returns A `WritableStream` of `Uint8Array`s.
 *
 * @example Convert `Deno.stdout` into a writable stream
 * ```ts no-eval no-assert
 * // Note that you can directly get the writer from `Deno.stdout` by
 * // `Deno.stdout.writable`. This example is just for demonstration purposes;
 * // definitely not a recommended way.
 *
 * import { writableStreamFromWriter } from "@std/streams/writable-stream-from-writer";
 *
 * const stdoutStream = writableStreamFromWriter(Deno.stdout);
 * ```
 *
 * @deprecated This will be removed in 1.0.0. Use {@linkcode https://jsr.io/@std/io/doc/~/toWritableStream | toWritableStream} instead.
 */ export function writableStreamFromWriter(writer, options = {}) {
  return toWritableStream(writer, options);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImh0dHBzOi8vanNyLmlvL0BzdGQvc3RyZWFtcy8wLjIyNC41L3dyaXRhYmxlX3N0cmVhbV9mcm9tX3dyaXRlci50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBDb3B5cmlnaHQgMjAxOC0yMDI0IHRoZSBEZW5vIGF1dGhvcnMuIEFsbCByaWdodHMgcmVzZXJ2ZWQuIE1JVCBsaWNlbnNlLlxuLy8gVGhpcyBtb2R1bGUgaXMgYnJvd3NlciBjb21wYXRpYmxlLlxuXG5pbXBvcnQgdHlwZSB7IFdyaXRlciB9IGZyb20gXCJqc3I6L0BzdGQvaW9AXjAuMjI0LjEvdHlwZXNcIjtcbmltcG9ydCB7IHRvV3JpdGFibGVTdHJlYW0gfSBmcm9tIFwianNyOi9Ac3RkL2lvQF4wLjIyNC4xL3RvLXdyaXRhYmxlLXN0cmVhbVwiO1xuXG4vKipcb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