-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented
fs.promises.glob
and fs.globSync
Organized emulation extra types
- Loading branch information
Showing
6 changed files
with
131 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type * as fs from 'node:fs'; | ||
|
||
/** | ||
* Options used for caching, among other things. | ||
* @internal @hidden *UNSTABLE* | ||
*/ | ||
export interface InternalOptions { | ||
/** | ||
* If true, then this readdir was called from another function. | ||
* In this case, don't clear the cache when done. | ||
* @internal *UNSTABLE* | ||
*/ | ||
_isIndirect?: boolean; | ||
} | ||
|
||
export interface ReaddirOptions extends InternalOptions { | ||
withFileTypes?: boolean; | ||
recursive?: boolean; | ||
} | ||
|
||
// Helper types to make the emulation types more readable | ||
|
||
/** Helper union @hidden */ | ||
export type GlobOptionsU = fs.GlobOptionsWithFileTypes | fs.GlobOptionsWithoutFileTypes | fs.GlobOptions; | ||
|
||
/** Helper with union @hidden */ | ||
export type ReaddirOptsU<T> = (ReaddirOptions & (fs.ObjectEncodingOptions | T)) | NullEnc; | ||
|
||
/** Helper with intersection @hidden */ | ||
export type ReaddirOptsI<T> = ReaddirOptions & fs.ObjectEncodingOptions & T; | ||
|
||
/** @hidden */ | ||
export type NullEnc = BufferEncoding | null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters