Skip to content

Commit c78e190

Browse files
author
Mike Pham
committed
feat: dirname
1 parent 70e3e41 commit c78e190

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/Core/Files.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class InternalFileSystem implements FileSystem {
2828
}, this.listfiles(filepath)))
2929
}
3030

31+
public dirname(filepath: string): string {
32+
return path.dirname(filepath)
33+
}
34+
3135
public exists(filepath: string): Promise<boolean> {
3236
return new Promise<boolean>((resolve, reject) => fs.exists(filepath, (exists: boolean) => resolve(exists)))
3337
}

‎src/Core/Interfaces/FileSystem.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface FileSystem {
66
basename(filepath: string): string
77
deepdirs(rootpath: string): Promise<string[]>
88
deepfiles(rootpath: string): Promise<string[]>
9+
dirname(filepath: string): string
910
exists(filepath: string): Promise<boolean>
1011
ext(filepath: string): string
1112
extensionless(filename: string): string

0 commit comments

Comments
 (0)