( app )
| 16 | } |
| 17 | |
| 18 | export function getAppType ( app ) { |
| 19 | |
| 20 | // Videos don't have a category |
| 21 | // so we check for videos here |
| 22 | if ( isVideo( app ) ) { |
| 23 | return 'video' |
| 24 | } |
| 25 | |
| 26 | if ( isDevice( app ) ) { |
| 27 | return 'device' |
| 28 | } |
| 29 | |
| 30 | if(app.category !== Object(app.category)) { |
| 31 | console.warn('app has no categories', app) |
| 32 | |
| 33 | return null |
| 34 | } |
| 35 | |
| 36 | if (app.category.slug === 'homebrew') return 'formula' |
| 37 | |
| 38 | if (app.category.slug === 'games') return 'game' |
| 39 | |
| 40 | return 'app' |
| 41 | } |
| 42 | |
| 43 | export function getAppEndpoint ( app ) { |
| 44 | // console.log('app', app) |
no test coverage detected