BREAKING: Include limited metadata in 'DirEntry' objects (#4941)

This change is to prevent needed a separate stat syscall for each file
when using readdir.

For consistency, this PR also modifies std's `WalkEntry` interface to
extend `DirEntry` with an additional `path` field.
This commit is contained in:
Bert Belder 2020-04-29 22:00:31 +02:00 committed by GitHub
parent 721a4ad59d
commit 3e6ea62841
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 193 additions and 206 deletions

View file

@ -1386,8 +1386,11 @@ declare namespace Deno {
* Requires `allow-read` permission. */
export function realpath(path: string): Promise<string>;
export interface DirEntry extends FileInfo {
export interface DirEntry {
name: string;
isFile: boolean;
isDirectory: boolean;
isSymlink: boolean;
}
/** Synchronously reads the directory given by `path` and returns an iterable