UNPKG

tiny-readdir-glob

Version:

A simple promisified recursive readdir function, with support for globs.

30 lines (29 loc) 938 B
import type { Dirent } from 'tiny-readdir'; type ArrayMaybe<T> = T[] | T; type PromiseMaybe<T> = Promise<T> | T; type Options = { cwd?: string; depth?: number; limit?: number; followSymlinks?: boolean; ignore?: ArrayMaybe<((targetPath: string) => boolean) | RegExp | string>; signal?: { aborted: boolean; }; onDirents?: (dirents: Dirent[]) => PromiseMaybe<undefined>; }; type Result = { directories: string[]; files: string[]; symlinks: string[]; directoriesFound: string[]; filesFound: string[]; symlinksFound: string[]; directoriesFoundNames: Set<string>; filesFoundNames: Set<string>; symlinksFoundNames: Set<string>; directoriesFoundNamesToPaths: Record<string, string[]>; filesFoundNamesToPaths: Record<string, string[]>; symlinksFoundNamesToPaths: Record<string, string[]>; }; export type { ArrayMaybe, PromiseMaybe, Dirent, Options, Result };