aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-10-05 18:00:13 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-10-05 18:07:41 -0700
commitca4c99b1bfa6488b36da11456e497f2e4bcd282d (patch)
tree7b65b2fedb42e89ea51a116ccd7c8df475eee42b /src/bun.js
parenta302549d3ea04e4bbe10e26ce13e06e496824cb1 (diff)
downloadbun-ca4c99b1bfa6488b36da11456e497f2e4bcd282d.tar.gz
bun-ca4c99b1bfa6488b36da11456e497f2e4bcd282d.tar.zst
bun-ca4c99b1bfa6488b36da11456e497f2e4bcd282d.zip
Fix interopRequireDefault issue with `path` :(
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/path-posix.exports.js1
-rw-r--r--src/bun.js/path.exports.js13
2 files changed, 11 insertions, 3 deletions
diff --git a/src/bun.js/path-posix.exports.js b/src/bun.js/path-posix.exports.js
index b3f61c1a2..43630421a 100644
--- a/src/bun.js/path-posix.exports.js
+++ b/src/bun.js/path-posix.exports.js
@@ -16,6 +16,7 @@ function bound(obj) {
};
}
var path = bound(Bun._Path(false));
+path[Symbol.for("CommonJS")] = 0;
export var {
basename,
diff --git a/src/bun.js/path.exports.js b/src/bun.js/path.exports.js
index 98f685fc1..41d437bd0 100644
--- a/src/bun.js/path.exports.js
+++ b/src/bun.js/path.exports.js
@@ -1,5 +1,5 @@
function bound(obj) {
- return {
+ var result = {
basename: obj.basename.bind(obj),
dirname: obj.dirname.bind(obj),
extname: obj.extname.bind(obj),
@@ -14,13 +14,17 @@ function bound(obj) {
sep: obj.sep,
delimiter: obj.delimiter,
};
+ result.default = result;
+ return result;
}
var path = bound(Bun._Path());
-path.win32 = win32;
-path.posix = posix;
+
export var posix = bound(Bun._Path(false));
export var win32 = bound(Bun._Path(true));
+path.win32 = win32;
+path.posix = posix;
+
export var {
basename,
dirname,
@@ -35,6 +39,9 @@ export var {
toNamespacedPath,
sep,
delimiter,
+ __esModule,
} = path;
+path[Symbol.for("CommonJS")] = 0;
+path.__esModule = true;
export default path;