app-platforms.ts
1 import type { AppPlatform } from '@jet-app/app-store/api/models'; 2 3 export const PlatformToExclusivityText: Partial<Record<AppPlatform, string>> = { 4 watch: 'ASE.Web.AppStore.App.OnlyForWatch', 5 tv: 'ASE.Web.AppStore.App.OnlyForAppleTV', 6 messages: 'ASE.Web.AppStore.App.OnlyForiMessage', 7 mac: 'ASE.Web.AppStore.App.OnlyForMac', 8 phone: 'ASE.Web.AppStore.App.OnlyForPhone', 9 }; 10 11 export function isPlatformSupported( 12 platform: AppPlatform, 13 appPlatforms: AppPlatform[], 14 ) { 15 const dedupedPlatforms = new Set(appPlatforms); 16 return dedupedPlatforms.has(platform); 17 } 18 19 export function isPlatformExclusivelySupported( 20 platform: AppPlatform, 21 appPlatforms: AppPlatform[], 22 ) { 23 const dedupedPlatforms = new Set(appPlatforms); 24 return dedupedPlatforms.has(platform) && dedupedPlatforms.size === 1; 25 }