Skip to content

Commit f5259d0

Browse files
committed
fix: @putout/plugin-nodejs: convert-esm-to-commonjs: epxorts -> exports
1 parent 116cd3e commit f5259d0

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.epxorts.hello = function hello(a, b, c) {};
1+
module.exports.hello = function hello(a, b, c) {};

packages/plugin-nodejs/lib/convert-esm-to-commonjs/fixture/export-function-fix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.epxorts.findMadrun = async function findMadrun(cwd) {
1+
module.exports.findMadrun = async function findMadrun(cwd) {
22
const madrunNames = [
33
'.madrun.js',
44
'.madrun.mjs',
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.epxorts.next = function* next(a, b) {
1+
module.exports.next = function* next(a, b) {
22
yield a;
33
yield b;
44
};

packages/plugin-nodejs/lib/convert-esm-to-commonjs/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export const report = () => `Use 'CommonJS' instead of 'ESM'`;
1313
export const replace = () => ({
1414
'export default __a': 'module.exports = __a',
1515
[`export ${CLASS}`]: `module.exports.__a = ${CLASS}`,
16-
[`export ${FN}`]: `module.epxorts.__a = ${FN}`,
17-
[`export ${ASYNC_FN}`]: `module.epxorts.__a = ${ASYNC_FN}`,
18-
[`export ${GEN_FN}`]: `module.epxorts.__a = ${GEN_FN}`,
16+
[`export ${FN}`]: `module.exports.__a = ${FN}`,
17+
[`export ${ASYNC_FN}`]: `module.exports.__a = ${ASYNC_FN}`,
18+
[`export ${GEN_FN}`]: `module.exports.__a = ${GEN_FN}`,
1919
'export const __a = __b': 'module.exports.__a = __b',
2020
'export {__exports}': ({__exports}) => {
2121
let result = 'module.exports = {\n';

0 commit comments

Comments
 (0)