Page MenuHomePhabricator

D6982.diff
No OneTemporary

D6982.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, 8:12 AM (13 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2690622
Default Alt Text
D6982.diff (693 B)

Event Timeline