summaryrefslogtreecommitdiff
path: root/src/utils/app-platforms.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/app-platforms.ts')
-rw-r--r--src/utils/app-platforms.ts25
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;
+}