From d849c87eb16a4bebee1a09c171dbdae6a4924a55 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Tue, 6 Apr 2021 00:05:55 +0200 Subject: chore: deprecate Deno.iter and Deno.iterSync (#10025) This commit marks the `Deno.iter` and `Deno.iterSync` utils as deprecated, and schedules them for removal in Deno 2.0. These utilities are implemented in pure JS, so should not be part of the Deno namespace. These utilities are now available in std/io/util: denoland/deno_std#843. --- cli/dts/lib.deno.ns.d.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'cli/dts/lib.deno.ns.d.ts') diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 1592ee5b2..4934c642d 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -312,7 +312,8 @@ declare namespace Deno { * * Implementations should not retain a reference to `p`. * - * Use Deno.iter() to turn a Reader into an AsyncIterator. + * Use iter() from https://deno.land/std/io/util.ts to turn a Reader into an + * AsyncIterator. */ read(p: Uint8Array): Promise; } @@ -336,7 +337,8 @@ declare namespace Deno { * * Implementations should not retain a reference to `p`. * - * Use Deno.iterSync() to turn a ReaderSync into an Iterator. + * Use iterSync() from https://deno.land/std/io/util.ts to turn a ReaderSync + * into an Iterator. */ readSync(p: Uint8Array): number | null; } @@ -422,7 +424,10 @@ declare namespace Deno { }, ): Promise; - /** Turns a Reader, `r`, into an async iterator. + /** + * @deprecated Use iter from https://deno.land/std/io/util.ts instead. Deno.iter will be removed in Deno 2.0. + * + * Turns a Reader, `r`, into an async iterator. * * ```ts * let f = await Deno.open("/etc/passwd"); @@ -458,7 +463,10 @@ declare namespace Deno { }, ): AsyncIterableIterator; - /** Turns a ReaderSync, `r`, into an iterator. + /** + * @deprecated Use iterSync from https://deno.land/std/io/util.ts instead. Deno.iterSync will be removed in Deno 2.0. + * + * Turns a ReaderSync, `r`, into an iterator. * * ```ts * let f = Deno.openSync("/etc/passwd"); -- cgit v1.2.3