Skip to content

Commit 76eecab

Browse files
committed
fix export of function as const
1 parent 122f69d commit 76eecab

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pythagora",
3-
"version": "0.0.70",
3+
"version": "0.0.73",
44
"author": {
55
"name": "Zvonimir Sabljic",
66
"email": "[email protected]"
@@ -18,7 +18,7 @@
1818
"prepublishOnly": "node src/bin/prepublish.js",
1919
"postinstall": "node src/bin/postinstall.js",
2020
"test": "npx jest ./pythagora_tests/ --coverage",
21-
"generate-unit-tests": "npx pythagora --unit-tests --path ./"
21+
"generate-unit-tests": "npx pythagora --unit-tests --path ./src"
2222
},
2323
"bin": {
2424
"pythagora": "src/bin/run.js"

src/utils/code.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,10 @@ function processAst(ast, cb) {
288288
// export class Class1 () { ... }
289289
return cb(path.node.declaration.id.name, path, 'exportObj');
290290
} else if (path.node.declaration.type === 'VariableDeclaration') {
291+
// export const const1 = 'constant';
292+
// export const func1 = () => { ... }
291293
path.node.declaration.declarations.forEach(declaration => {
292-
return cb(declaration.id.name, path, 'exportFn');
294+
return cb(declaration.id.name, path, 'exportObj');
293295
});
294296
} else if (path.node.declaration.type === 'ClassDeclaration') {
295297
// export class Class1 { ... }

0 commit comments

Comments
 (0)