Skip to content

Commit 871dd09

Browse files
committed
refactor: Make main function exportable and callable
This change refactors the `index.js` file to allow the `main` function to be both exportable and callable by other modules. The original code executed `main` directly when the script was run as the main module. This behavior has been removed to improve modularity and testability. Now the `main` function can be imported and called explicitly, enabling better integration with testing frameworks and other parts of the application. The conditional execution `if (require.main === module) { main(); }` has been removed.
1 parent 557cf98 commit 871dd09

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ async function main() {
1313
}
1414
}
1515

16-
if (require.main === module) {
17-
main();
18-
}
19-
2016
module.exports = {
2117
main,
2218
};

0 commit comments

Comments
 (0)