@uppy/utils
Version:
Shared utility functions for Uppy Core and plugins maintained by the Uppy team.
16 lines (15 loc) • 345 B
text/typescript
/**
* Checks if current device reports itself as “mobile”.
* Very simple, not very reliable.
*/
export default function isMobileDevice(): boolean {
if (
typeof window !== 'undefined' &&
window.navigator &&
window.navigator.userAgent &&
window.navigator.userAgent.match(/Mobi/)
) {
return true
}
return false
}