File tree Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,11 @@ declare module 'fs' {
220
220
* @since v10.10.0
221
221
*/
222
222
name : string ;
223
+ /**
224
+ * The base path that this `fs.Dirent` object refers to.
225
+ * @since v18.17.0
226
+ */
227
+ path : string ;
223
228
}
224
229
/**
225
230
* A class representing a directory stream.
Original file line number Diff line number Diff line change @@ -434,6 +434,7 @@ async function testPromisify() {
434
434
{
435
435
fs . opendir ( 'test' , async ( err , dir ) => {
436
436
const dirEnt : fs . Dirent | null = await dir . read ( ) ;
437
+ dirEnt ?. path ; // $ExpectType string | undefined
437
438
} ) ;
438
439
439
440
fs . opendir ( Buffer . from ( 'test' ) , async ( err , dir ) => {
Original file line number Diff line number Diff line change @@ -220,6 +220,11 @@ declare module 'fs' {
220
220
* @since v10.10.0
221
221
*/
222
222
name : string ;
223
+ /**
224
+ * The base path that this `fs.Dirent` object refers to.
225
+ * @since v18.17.0
226
+ */
227
+ path : string ;
223
228
}
224
229
/**
225
230
* A class representing a directory stream.
Original file line number Diff line number Diff line change @@ -434,6 +434,7 @@ async function testPromisify() {
434
434
{
435
435
fs . opendir ( 'test' , async ( err , dir ) => {
436
436
const dirEnt : fs . Dirent | null = await dir . read ( ) ;
437
+ dirEnt ?. path ; // $ExpectType string | undefined
437
438
} ) ;
438
439
439
440
fs . opendir ( Buffer . from ( 'test' ) , async ( err , dir ) => {
You can’t perform that action at this time.
0 commit comments