@uifabric/utilities
Version:
Fluent UI React utilities for building components.
19 lines • 748 B
JavaScript
define(["require", "exports", "./dom/getWindow"], function (require, exports, getWindow_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isMacResult;
/**
* Returns true if the user is on a Mac. Caches the result value.
* @param reset - Reset the cached result value (mainly for testing).
*/
function isMac(reset) {
if (typeof isMacResult === 'undefined' || reset) {
var win = getWindow_1.getWindow();
var userAgent = win && win.navigator.userAgent;
isMacResult = !!userAgent && userAgent.indexOf('Macintosh') !== -1;
}
return !!isMacResult;
}
exports.isMac = isMac;
});
//# sourceMappingURL=osDetector.js.map