From 709651a0de373ca2db143b91cb53793d1c2e0e2e Mon Sep 17 00:00:00 2001 From: Titus Date: Fri, 16 Jun 2023 13:43:12 -0600 Subject: [PATCH 1/3] Verify default exists before extending it --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index a92d556..8db7bc9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,6 @@ export { ono }; export default ono; // CommonJS default export hack -if (typeof module === "object" && typeof module.exports === "object") { +if (typeof module === "object" && typeof module.exports === "object" && typeof module.exports.default == "object") { module.exports = Object.assign(module.exports.default, module.exports); } From c00f5c42090f43764313f7df314aaf4ff1408276 Mon Sep 17 00:00:00 2001 From: Titus Stone Date: Fri, 16 Jun 2023 13:51:32 -0600 Subject: [PATCH 2/3] Revert "Verify default exists before extending it" This reverts commit 709651a0de373ca2db143b91cb53793d1c2e0e2e. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 8db7bc9..a92d556 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,6 @@ export { ono }; export default ono; // CommonJS default export hack -if (typeof module === "object" && typeof module.exports === "object" && typeof module.exports.default == "object") { +if (typeof module === "object" && typeof module.exports === "object") { module.exports = Object.assign(module.exports.default, module.exports); } From a85834537d3b144aa45fd150df1acf47673271d3 Mon Sep 17 00:00:00 2001 From: Titus Stone Date: Fri, 16 Jun 2023 13:52:17 -0600 Subject: [PATCH 3/3] verify default exists too --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index a92d556..8db7bc9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,6 @@ export { ono }; export default ono; // CommonJS default export hack -if (typeof module === "object" && typeof module.exports === "object") { +if (typeof module === "object" && typeof module.exports === "object" && typeof module.exports.default == "object") { module.exports = Object.assign(module.exports.default, module.exports); }