Skip to content

Commit a43e598

Browse files
committed
fix: wrap default realpath in trycatch
1 parent 5f1e7f2 commit a43e598

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/node.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export const fs = {
1616
return JSON.parse(readFileSync(file, "utf8"));
1717
},
1818
realpath(file) {
19-
return fsRealPath(file);
19+
try {
20+
return fsRealPath(file);
21+
} catch {
22+
return file;
23+
}
2024
},
2125
};

0 commit comments

Comments
 (0)