UNPKG

@modern-kit/utils

Version:
26 lines (22 loc) 570 B
'use strict'; var deviceIsServer = require('../isServer/index.cjs'); var deviceIsMobile = require('../isMobile/index.cjs'); function getOS() { if (deviceIsServer.isServer()) { return "server"; } const isIos = !!window.navigator.userAgent.match(/ipad|iphone|ipod/i); if (isIos) { return "ios"; } const isAndroid = !!window.navigator.userAgent.match(/Android/i); if (isAndroid) { return "android"; } if (deviceIsMobile.isMobile()) { return "otherMobile"; } return "web"; } exports.getOS = getOS; //# sourceMappingURL=index.cjs.map