Skip to content

Commit 11b158c

Browse files
committed
Update Platform.web.js
1 parent dd344e6 commit 11b158c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Libraries/Utilities/Platform.web.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010

1111
'use strict';
1212

13+
export type PlatformSelectSpec<D, I> = {
14+
default?: D,
15+
web?: I,
16+
};
17+
1318
const Platform = {
1419
OS: 'web',
15-
select: (obj: Object) => ('web' in obj ? obj.web : obj.default),
20+
select: <D, I>(spec: PlatformSelectSpec<D, I>): D | I =>
21+
'web' in spec ? spec.web : spec.default,
1622
};
1723

1824
module.exports = Platform;

0 commit comments

Comments
 (0)