Skip to content

Commit ee23ac5

Browse files
committed
remove IIFE code style in main code
1 parent 944d1fc commit ee23ac5

File tree

1 file changed

+34
-36
lines changed

1 file changed

+34
-36
lines changed

src/cli/main.js

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,43 @@ const DATA_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', '
3333
//// MYMMMM9 _MM_ _dM_ _dMM__MM_ \M\_ _MM_ /////
3434
/////////////////////////////////////////////////////////////////////
3535

36-
(async function() {
37-
do {
38-
console.clear()
39-
print(`
36+
do {
37+
console.clear()
38+
print(`
4039
==========================
41-
WELCOME!
40+
WELCOME!
4241
==========================
4342
SIMPLE LINEAR REGRESSION DEMO
44-
`)
45-
46-
const answers = await select({
47-
message: 'Choose menu',
48-
choices: [
49-
'1. Guide',
50-
'2. Run Demo',
51-
'3. Exit'
52-
]
53-
})
54-
55-
console.clear()
56-
57-
58-
switch (answers) {
59-
case '1. Guide':
60-
await showGuide()
61-
break;
62-
case '2. Run Demo':
63-
await runDemo()
64-
break;
65-
case '3. Exit':
66-
print('Thanks, bye!')
67-
exit(0)
68-
break;
69-
default:
70-
print('Invalid input!')
71-
break;
72-
}
73-
} while (await confirm({ message: '\nContinue program? ' }))
74-
})();
43+
`)
44+
45+
const answers = await select({
46+
message: 'Choose menu',
47+
choices: [
48+
'1. Guide',
49+
'2. Run Demo',
50+
'3. Exit'
51+
]
52+
})
53+
54+
console.clear()
55+
56+
57+
switch (answers) {
58+
case '1. Guide':
59+
await showGuide()
60+
break;
61+
case '2. Run Demo':
62+
await runDemo()
63+
break;
64+
case '3. Exit':
65+
print('Thanks, bye!')
66+
exit(0)
67+
break;
68+
default:
69+
print('Invalid input!')
70+
break;
71+
}
72+
} while (await confirm({ message: '\nContinue program? ' }))
7573

7674

7775

0 commit comments

Comments
 (0)