summaryrefslogtreecommitdiff
path: root/node_modules/@jet-app/app-store/tmp/src/api/models/preview-platform.js
blob: 387e689cb84ef081f35a48199b83e1a64e62b1df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { isNothing } from "@jet/environment/types/optional";
/**
 * All {@linkcode PreviewPlatform}, defined in their order of precidence
 */
export const allPreviewPlatforms = ["iphone", "ipad", "mac", "vision", "watch", "tv"];
/**
 * Determines if {@linkcode input} is a {@linkcode PreviewPlatform}
 */
export function isPreviewPlatform(input) {
    return allPreviewPlatforms.includes(input);
}
/**
 * Normalize some {@linkcode input} into a {@linkcode PreviewPlatform}, if possible
 */
export function normalizePreviewPlaform(input) {
    if (isNothing(input)) {
        return undefined;
    }
    const normalized = input.toLocaleLowerCase();
    if (isPreviewPlatform(normalized)) {
        return normalized;
    }
    return undefined;
}
//# sourceMappingURL=preview-platform.js.map