1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00

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.
This commit is contained in:
Luca Casonato 2021-04-06 00:05:55 +02:00 committed by GitHub
parent da60e2afcb
commit d849c87eb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<number | null>;
}
@ -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<number>;
/** 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<Uint8Array>;
/** 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");