File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,10 @@ function logRoutes(data: Data) {
101
101
102
102
const kaomojis = [ '♡⸜(˶˃ ᵕ ˂˶)⸝♡' , '♡( ◡‿◡ )' , '( ˶ˆ ᗜ ˆ˵ )' , '(˶ᵔ ᵕ ᵔ˶)' ]
103
103
104
- // Get system current language
104
+ function randomItem ( items : string [ ] ) : string {
105
+ const index = Math . floor ( Math . random ( ) * items . length )
106
+ return items . at ( index ) ?? ''
107
+ }
105
108
106
109
app . listen ( port , ( ) => {
107
110
console . log (
@@ -110,7 +113,7 @@ app.listen(port, () => {
110
113
chalk . gray ( 'Press CTRL-C to stop' ) ,
111
114
chalk . gray ( `Watching ${ file } ...` ) ,
112
115
'' ,
113
- chalk . magenta ( kaomojis [ Math . floor ( Math . random ( ) * kaomojis . length ) ] ) ,
116
+ chalk . magenta ( randomItem ( kaomojis ) ) ,
114
117
'' ,
115
118
chalk . bold ( 'Index:' ) ,
116
119
chalk . gray ( `http://localhost:${ port } /` ) ,
You can’t perform that action at this time.
0 commit comments