Closed MarianoFacundoArch closed 5 months ago
You can use it already, just import the enums from 'ua-parser-js/enums'
submodule:
import { UAParser } from 'ua-parser-js';
import { OS } from 'ua-parser-js/enums';
const ua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.32';
const currentOSName = UAParser(ua).os.name;
if (currentOSName === OS.LINUX) {
console.log('Hello! you are using Linux');
}
It would be nice if we could export the ENUMS to make comparisons later on without relying on strings, for example if (currentOsName === LINUX)