Skip to content

Commit fa1177d

Browse files
committed
Make the require("stampit") work without the .default, the Node.js has the customized require(esm) syntax
1 parent eb1c51e commit fa1177d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

stampit.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,3 +360,5 @@ staticUtils.deepConf = staticUtils.deepConfiguration;
360360
export default function stampit(...args) {
361361
return compose(this, { staticProperties: staticUtils }, ...args.map(standardiseDescriptor));
362362
}
363+
364+
export { stampit as "module.exports" };

test/import.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ const require = createRequire(import.meta.url);
66

77
describe("import", () => {
88
it('infection works using the require("stampit")', () => {
9-
const obj = require("../stampit.js")
10-
.default()
9+
const obj = require("../stampit.js")()
1110
.init(function () {
1211
const secret = "foo";
1312
this.getSecret = () => {

0 commit comments

Comments
 (0)