Page MenuHomePhabricator

D6982.id23519.diff
No OneTemporary

D6982.id23519.diff

diff --git a/lib/types/device-types.js b/lib/types/device-types.js
--- a/lib/types/device-types.js
+++ b/lib/types/device-types.js
@@ -2,9 +2,17 @@
import invariant from 'invariant';
-export type DeviceType = 'ios' | 'android';
+import { values } from '../utils/objects.js';
+
+const deviceTypesObj = Object.freeze({
+ ios: 'ios',
+ android: 'android',
+});
+export type DeviceType = $Values<typeof deviceTypesObj>;
export type Platform = DeviceType | 'web' | 'windows' | 'macos';
+export const deviceTypes: $ReadOnlyArray<DeviceType> = values(deviceTypesObj);
+
export function isDeviceType(platform: ?string): boolean {
return platform === 'ios' || platform === 'android';
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 6:20 PM (18 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2690622
Default Alt Text
D6982.id23519.diff (693 B)

Event Timeline