diff options
| author | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
|---|---|---|
| committer | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
| commit | bce557cc2dc767628bed6aac87301a1be7c5431b (patch) | |
| tree | b51a051228d01fe3306cd7626d4a96768aadb944 /src/utils/app-platforms.ts | |
init commit
Diffstat (limited to 'src/utils/app-platforms.ts')
| -rw-r--r-- | src/utils/app-platforms.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/utils/app-platforms.ts b/src/utils/app-platforms.ts new file mode 100644 index 0000000..1adb840 --- /dev/null +++ b/src/utils/app-platforms.ts @@ -0,0 +1,25 @@ +import type { AppPlatform } from '@jet-app/app-store/api/models'; + +export const PlatformToExclusivityText: Partial<Record<AppPlatform, string>> = { + watch: 'ASE.Web.AppStore.App.OnlyForWatch', + tv: 'ASE.Web.AppStore.App.OnlyForAppleTV', + messages: 'ASE.Web.AppStore.App.OnlyForiMessage', + mac: 'ASE.Web.AppStore.App.OnlyForMac', + phone: 'ASE.Web.AppStore.App.OnlyForPhone', +}; + +export function isPlatformSupported( + platform: AppPlatform, + appPlatforms: AppPlatform[], +) { + const dedupedPlatforms = new Set(appPlatforms); + return dedupedPlatforms.has(platform); +} + +export function isPlatformExclusivelySupported( + platform: AppPlatform, + appPlatforms: AppPlatform[], +) { + const dedupedPlatforms = new Set(appPlatforms); + return dedupedPlatforms.has(platform) && dedupedPlatforms.size === 1; +} |
