You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that Deno.readDirSync() returns an ArrayIterator object (I was typing Deno.readDirSync("some-dir") in a jupyter notebook and it logs Object [Array Iterator] {}). I wanted to see the list of folders, to I added .toArray() at the end of it and got a type checking error: .toArray() (and all iterator helpers) are not available on Iterable<...>.
Given that readDirSyncdoes return an iterator, could its type definition be updated?
EDIT: Probably there are many functions on the Deno namespace, both sync and async, that should be updated :)
The text was updated successfully, but these errors were encountered:
nicolo-ribaudo
changed the title
readDirSync should return an IterableIteratorreadDirSync should return an IteratorObject
Jan 10, 2025
nicolo-ribaudo
changed the title
readDirSync should return an IteratorObjectreadDirSync should return an IteratorObjectJan 10, 2025
nicolo-ribaudo
changed the title
readDirSync should return an IteratorObjectreadDirSync's type definition should return an IteratorObjectJan 10, 2025
Version: Deno 2.1.5
I noticed that
Deno.readDirSync()
returns anArrayIterator
object (I was typingDeno.readDirSync("some-dir")
in a jupyter notebook and it logsObject [Array Iterator] {}
). I wanted to see the list of folders, to I added.toArray()
at the end of it and got a type checking error:.toArray()
(and all iterator helpers) are not available onIterable<...>
.Given that
readDirSync
does return an iterator, could its type definition be updated?EDIT: Probably there are many functions on the
Deno
namespace, both sync and async, that should be updated :)The text was updated successfully, but these errors were encountered: