UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

27 lines (24 loc) 573 B
/** * Returns true if the page is on a mobile device, false if not. * * @remarks * It takes 0 arguments. * * `isDeviceMobile()` * * * ## Usage * * - `isDeviceMobile()` - returns true or false depending if the device is a touch device or not. * */ import {BaseMethod} from './_Base'; import {CoreUserAgent} from '../../../core/UserAgent'; export class isDeviceMobileExpression extends BaseMethod { static override requiredArguments() { return []; } override async processArguments(args: any[]): Promise<boolean> { return CoreUserAgent.isMobile(); } }