1 import { isBrowser } from "@utils/browser";
3 const platformString = () =>
4 navigator.platform?.match(/mac|win|linux/i)?.[0].toLowerCase();
5 const getPlatformPredicate = (platform: string) => () =>
6 isBrowser() && platformString() === platform;
7 const isWin = getPlatformPredicate("win");
8 const isMac = getPlatformPredicate("mac");
9 const isLinux = getPlatformPredicate("linux");
11 const platform = { isWin, isMac, isLinux };
13 export default platform;