File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ class Game {
4444 */
4545 constructor ( game ) {
4646 this . game = game ;
47- this . id = ( games . find ( ( g ) => g . code === this . game || g . id === this . game ) . id ? games . find ( ( g ) => g . code === this . game || g . id === this . game ) . id : 'Not found' ) ;
48- this . code = ( games . find ( ( g ) => g . code === this . game || g . id === this . game ) . code ? games . find ( ( g ) => g . code === this . game || g . id === this . game ) . code : 'Not found' ) ;
47+ this . id = ( games . some ( ( g ) => g . code === this . game || g . id === this . game ) ? games . find ( ( g ) => g . code === this . game || g . id === this . game ) . id : 'Not found' ) ;
48+ this . code = ( games . some ( ( g ) => g . code === this . game || g . id === this . game ) ? games . find ( ( g ) => g . code === this . game || g . id === this . game ) . code : 'Not found' ) ;
4949 }
5050
5151 /**
@@ -54,9 +54,9 @@ class Game {
5454 */
5555 toString ( ) {
5656 if ( isNaN ( this . game ) ) {
57- return games . find ( ( g ) => g . code === this . game ) ? games . find ( ( g ) => g . code === this . game ) . name : 'Not found' ;
57+ return games . some ( ( g ) => g . code === this . game ) ? games . find ( ( g ) => g . code === this . game ) . name : 'Not found' ;
5858 } else {
59- return games . find ( ( g ) => g . id === this . game ) ? games . find ( ( g ) => g . id === this . game ) . name : 'Not found' ;
59+ return games . some ( ( g ) => g . id === this . game ) ? games . find ( ( g ) => g . id === this . game ) . name : 'Not found' ;
6060 }
6161 }
6262}
You can’t perform that action at this time.
0 commit comments