Skip to content

Commit

Permalink
fix: check process.cwd before calling it (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen authored Dec 12, 2023
1 parent 5930a85 commit 0bb67d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const join: typeof path.join = function (...arguments_) {
};

function cwd() {
if (typeof process !== "undefined") {
if (typeof process !== "undefined" && typeof process.cwd === "function") {
return process.cwd().replace(/\\/g, "/");
}
return "/";
Expand Down

0 comments on commit 0bb67d4

Please sign in to comment.