[internals] added isIOS / isAndroid utils
This commit is contained in:
parent
5864481781
commit
2755fd2433
|
@ -1,9 +1,8 @@
|
||||||
import {Platform} from 'react-native';
|
// @flow
|
||||||
|
import { Platform } from 'react-native';
|
||||||
|
|
||||||
// todo cleanup unused utilities from legacy code
|
// todo cleanup unused utilities from legacy code
|
||||||
/**
|
|
||||||
* @flow
|
|
||||||
*/
|
|
||||||
// modeled after base64 web-safe chars, but ordered by ASCII
|
// modeled after base64 web-safe chars, but ordered by ASCII
|
||||||
const PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
|
const PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
|
||||||
const hasOwnProperty = Object.hasOwnProperty;
|
const hasOwnProperty = Object.hasOwnProperty;
|
||||||
|
@ -88,10 +87,18 @@ export function isString(value): Boolean {
|
||||||
return typeof value === 'string';
|
return typeof value === 'string';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if on ios
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
export function isIOS() {
|
export function isIOS() {
|
||||||
return Platform.OS === 'ios';
|
return Platform.OS === 'ios';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if on android
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
export function isAndroid() {
|
export function isAndroid() {
|
||||||
return Platform.OS === 'android';
|
return Platform.OS === 'android';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue