UNPKG

633 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var getWindow_1 = require("./dom/getWindow");
4var 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 */
9function 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}
17exports.isMac = isMac;
18//# sourceMappingURL=osDetector.js.map
\No newline at end of file