[internals] added isIOS / isAndroid utils

This commit is contained in:
Salakar 2017-09-23 18:25:48 +01:00
parent 5864481781
commit 2755fd2433
1 changed files with 11 additions and 4 deletions

View File

@ -1,9 +1,8 @@
import {Platform} from 'react-native';
// @flow
import { Platform } from 'react-native';
// todo cleanup unused utilities from legacy code
/**
* @flow
*/
// modeled after base64 web-safe chars, but ordered by ASCII
const PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
const hasOwnProperty = Object.hasOwnProperty;
@ -88,10 +87,18 @@ export function isString(value): Boolean {
return typeof value === 'string';
}
/**
* Returns true if on ios
* @returns {boolean}
*/
export function isIOS() {
return Platform.OS === 'ios';
}
/**
* Returns true if on android
* @returns {boolean}
*/
export function isAndroid() {
return Platform.OS === 'android';
}