UNPKG

@mdxeditor/editor

Version:

React component for rich text markdown editing

18 lines (17 loc) 500 B
const CAN_USE_DOM = typeof window !== "undefined" && typeof window.document.createElement !== "undefined"; const IS_APPLE = CAN_USE_DOM && (() => { var _a; const platform = (_a = navigator.userAgentData) == null ? void 0 : _a.platform; return platform ? /mac/i.test(platform) : /Mac|iPod|iPhone|iPad/.test(navigator.userAgent); })(); function controlOrMeta(metaKey, ctrlKey) { if (IS_APPLE) { return metaKey; } return ctrlKey; } export { CAN_USE_DOM, IS_APPLE, controlOrMeta };