Skip to content

Commit 1771fcd

Browse files
committed
Add isSupportedTriplet to host
1 parent acf1a7c commit 1771fcd

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/host/src/node/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
export {
2+
SUPPORTED_TRIPLETS,
23
ANDROID_TRIPLETS,
34
APPLE_TRIPLETS,
4-
SUPPORTED_TRIPLETS,
5+
type SupportedTriplet,
56
type AndroidTriplet,
67
type AppleTriplet,
7-
type SupportedTriplet,
8+
isSupportedTriplet,
89
isAppleTriplet,
910
isAndroidTriplet,
1011
} from "./prebuilds/triplets.js";

packages/host/src/node/prebuilds/triplets.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,20 @@ export const SUPPORTED_TRIPLETS = [
3232

3333
export type SupportedTriplet = (typeof SUPPORTED_TRIPLETS)[number];
3434

35+
export function isSupportedTriplet(
36+
triplet: unknown
37+
): triplet is SupportedTriplet {
38+
return (SUPPORTED_TRIPLETS as readonly unknown[]).includes(triplet);
39+
}
40+
3541
export function isAndroidTriplet(
3642
triplet: SupportedTriplet
3743
): triplet is AndroidTriplet {
38-
return ANDROID_TRIPLETS.includes(triplet as AndroidTriplet);
44+
return (ANDROID_TRIPLETS as readonly unknown[]).includes(triplet);
3945
}
4046

4147
export function isAppleTriplet(
4248
triplet: SupportedTriplet
4349
): triplet is AppleTriplet {
44-
return APPLE_TRIPLETS.includes(triplet as AppleTriplet);
50+
return (APPLE_TRIPLETS as readonly unknown[]).includes(triplet);
4551
}

0 commit comments

Comments
 (0)