UNPKG

1.05 kBSource Map (JSON)View Raw
1{"version":3,"file":"osDetector.js","sourceRoot":"../src/","sources":["osDetector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,IAAI,WAAgC,CAAC;AAErC;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,KAAe;IACnC,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,KAAK,EAAE;QAC/C,IAAM,GAAG,GAAG,SAAS,EAAE,CAAC;QACxB,IAAM,SAAS,GAAG,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC;QAEjD,WAAW,GAAG,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;KACpE;IACD,OAAO,CAAC,CAAC,WAAW,CAAC;AACvB,CAAC","sourcesContent":["import { getWindow } from './dom/getWindow';\n\nlet isMacResult: boolean | undefined;\n\n/**\n * Returns true if the user is on a Mac. Caches the result value.\n * @param reset - Reset the cached result value (mainly for testing).\n */\nexport function isMac(reset?: boolean): boolean {\n if (typeof isMacResult === 'undefined' || reset) {\n const win = getWindow();\n const userAgent = win && win.navigator.userAgent;\n\n isMacResult = !!userAgent && userAgent.indexOf('Macintosh') !== -1;\n }\n return !!isMacResult;\n}\n"]}
\No newline at end of file