Skip to content

Commit 567c5a1

Browse files
authored
fix: reintroduce default property to improve CJS and ESM interoperability (#26)
* handle export and update tests * fix: run formatter
1 parent d8f28d3 commit 567c5a1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ exports.default = profiles;
1414

1515
module.exports = profiles;
1616
module.exports.proxyBundle = proxyBundle;
17+
module.exports.default = profiles;

test/e2e/require.test.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22

33
const { test, strict } = require('poku');
44
const awsCaBundle = require('../../lib/index.js');
5+
const { ca: awsCas } = require('../../lib/index.js').default;
56
const { proxyBundle } = require('../../lib/index.js');
67

78
test('Testing require (CJS)', () => {
89
strict(typeof awsCaBundle?.ca?.length === 'number', 'Default require');
10+
strict(
11+
typeof awsCas?.length === 'number',
12+
'Default require with default property present'
13+
);
914
strict(typeof proxyBundle?.ca?.length === 'number', '"proxyBundle" require');
1015
strict(
1116
typeof awsCaBundle.proxyBundle?.ca?.length === 'number',

0 commit comments

Comments
 (0)