first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import { getWindow } from './dom/getWindow';
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).
*/
export function isMac(reset) {
var _a;
if (typeof isMacResult === 'undefined' || reset) {
var win = getWindow();
// In certain SSR frameworks, `window` will be defined even on the server but `navigator` will be undefined
var userAgent = (_a = win === null || win === void 0 ? void 0 : win.navigator) === null || _a === void 0 ? void 0 : _a.userAgent;
isMacResult = !!userAgent && userAgent.indexOf('Macintosh') !== -1;
}
return !!isMacResult;
}
//# sourceMappingURL=osDetector.js.map