Skip to content

Commit

Permalink
Replace the ternary to logical in main exec
Browse files Browse the repository at this point in the history
While it's not considered good practice we just want `main()` to be
"evaluated" and otherwise do nothing.
  • Loading branch information
AndreMiras committed Dec 10, 2019
1 parent 2b79fb3 commit 7b651ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ module.exports = {
main,
};
exports = module.exports;
mainIsModule(require.main, module) ? main(process.argv) : null;
mainIsModule(require.main, module) && main(process.argv);
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@ const main = (mainCallback) => {
};

const mainIsModule = (module, main) => main === module;
mainIsModule(require.main, module) ? main() : null;
mainIsModule(require.main, module) && main();

module.exports = { stringifyLog, sessionPost, login, getCards, getDetailCard, getClearPin, main };

0 comments on commit 7b651ef

Please sign in to comment.