react-facebook-auth
Version:
A Component React for Facebook authentication
31 lines (29 loc) • 662 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toQueryString = toQueryString;
exports.isMobile = isMobile;
/**
* Encode object to url parameters
*
* @param object
* @return {string}
*/
function toQueryString(object) {
return Object.keys(object).map(function (key) {
return key + '=' + encodeURIComponent(object[key]);
}).join('&');
}
/**
* Check if device is mobile
*
* @return {boolean}
*/
function isMobile() {
try {
return !!(window.navigator && window.navigator.standalone || navigator.userAgent.match('CriOS') || navigator.userAgent.match(/mobile/i));
} catch (ex) {
return false;
}
}