UNPKG

748 BJavaScriptView Raw
1define(["require", "exports", "./dom/getWindow"], function (require, exports, getWindow_1) {
2 "use strict";
3 Object.defineProperty(exports, "__esModule", { value: true });
4 var isMacResult;
5 /**
6 * Returns true if the user is on a Mac. Caches the result value.
7 * @param reset - Reset the cached result value (mainly for testing).
8 */
9 function isMac(reset) {
10 if (typeof isMacResult === 'undefined' || reset) {
11 var win = getWindow_1.getWindow();
12 var userAgent = win && win.navigator.userAgent;
13 isMacResult = !!userAgent && userAgent.indexOf('Macintosh') !== -1;
14 }
15 return !!isMacResult;
16 }
17 exports.isMac = isMac;
18});
19//# sourceMappingURL=osDetector.js.map
\No newline at end of file