Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3509778
D6982.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
693 B
Referenced Files
None
Subscribers
None
D6982.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 8:12 AM (13 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2690622
Default Alt Text
D6982.diff (693 B)
Attached To
Mode
D6982: [lib] Add deviceTypes constant for enumerating all valid mobile device types
Attached
Detach File
Event Timeline
Log In to Comment