aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-30 03:11:58 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-30 03:11:58 -0700
commit65ea1e464755a165a29680f12f02eb37ccfd8ecf (patch)
tree5e1437046fb9e778a4cc27a1d699f80dd031e6a3 /src/runtime.js
parentf8f85430c08b273d5e551667391992fb3587c228 (diff)
downloadbun-65ea1e464755a165a29680f12f02eb37ccfd8ecf.tar.gz
bun-65ea1e464755a165a29680f12f02eb37ccfd8ecf.tar.zst
bun-65ea1e464755a165a29680f12f02eb37ccfd8ecf.zip
[Bun.js] Fix entry point to only call default if it was a CommonJS transformed function
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime.js b/src/runtime.js
index 0c4f53930..07219436d 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -136,6 +136,11 @@ export var __commonJS = (cb, name) => {
export var __cJS2eSM = __commonJS;
+export var __internalIsCommonJSNamespace = (namespace) =>
+ typeof namespace === "object" &&
+ "default" in namespace &&
+ namespace.default[cjsRequireSymbol];
+
export var __require = (namespace) => {
const namespaceType = typeof namespace;
if (namespaceType === "function" && namespace[cjsRequireSymbol])