Skip to content

Commit

Permalink
fix: readdir(recursive) normalize to unix filepath sep. in filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsch318 committed Apr 10, 2024
1 parent 6cf23a9 commit 126d8a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,11 @@ export class Volume implements FsCallbackApi, FsSynchronousApi {

return list.map(dirent => {
if (options.recursive) {
return pathModule.join(dirent.path, dirent.name.toString()).replace(filename2 + pathModule.posix.sep, '');
let fullPath = pathModule.join(dirent.path, dirent.name.toString());
if (isWin) {
fullPath.replace(/\\/g, '/');
}
return fullPath.replace(filename2 + pathModule.posix.sep, '');
}
return dirent.name;
});
Expand Down

0 comments on commit 126d8a8

Please sign in to comment.