@@ -221,7 +221,7 @@ function system(callback) {
221
221
// const version = util.getValue(lines, 'version', '=', true);
222
222
result . manufacturer = util . getValue ( lines , 'manufacturer' , '=' , true ) ;
223
223
result . model = model . key ;
224
- result . type = macOsChassisType ( model . model ) ;
224
+ result . type = macOsChassisType ( model . version ) ;
225
225
result . version = model . version ;
226
226
result . serial = util . getValue ( lines , 'ioplatformserialnumber' , '=' , true ) ;
227
227
result . uuid = util . getValue ( lines , 'ioplatformuuid' , '=' , true ) . toLowerCase ( ) ;
@@ -607,13 +607,13 @@ exports.baseboard = baseboard;
607
607
608
608
function macOsChassisType ( model ) {
609
609
model = model . toLowerCase ( ) ;
610
- if ( model . startsWith ( 'macbookair' ) ) { return 'Notebook' ; }
611
- if ( model . startsWith ( 'macbookpro' ) ) { return 'Laptop ' ; }
612
- if ( model . startsWith ( 'macbook' ) ) { return 'Notebook' ; }
613
- if ( model . startsWith ( 'macmini' ) ) { return 'Desktop' ; }
614
- if ( model . startsWith ( 'imac' ) ) { return 'Desktop' ; }
615
- if ( model . startsWith ( 'macstudio' ) ) { return 'Desktop' ; }
616
- if ( model . startsWith ( 'macpro' ) ) { return 'Tower' ; }
610
+ if ( model . indexOf ( 'macbookair' ) >= 0 || model . indexOf ( 'macbook air' ) >= 0 ) { return 'Notebook' ; }
611
+ if ( model . indexOf ( 'macbookpro' ) >= 0 || model . indexOf ( 'macbook pro' ) >= 0 ) { return 'Notebook ' ; }
612
+ if ( model . indexOf ( 'macbook' ) >= 0 ) { return 'Notebook' ; }
613
+ if ( model . indexOf ( 'macmini' ) >= 0 || model . indexOf ( 'mac mini' ) >= 0 ) { return 'Desktop' ; }
614
+ if ( model . indexOf ( 'imac' ) >= 0 ) { return 'Desktop' ; }
615
+ if ( model . indexOf ( 'macstudio' ) >= 0 || model . indexOf ( 'mac studio' ) >= 0 ) { return 'Desktop' ; }
616
+ if ( model . indexOf ( 'macpro' ) >= 0 || model . indexOf ( 'mac pro' ) >= 0 ) { return 'Tower' ; }
617
617
return 'Other' ;
618
618
}
619
619
0 commit comments