We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e951af commit b091366Copy full SHA for b091366
packages/vue-prism-editor/src/Editor.ts
@@ -16,8 +16,8 @@ const KEYCODE_ESCAPE = 27;
16
const HISTORY_LIMIT = 100;
17
const HISTORY_TIME_GAP = 3000;
18
19
-const isWindows = 'navigator' in global && /Win/i.test(navigator.platform);
20
-const isMacLike = 'navigator' in global && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
+const isWindows = typeof window !== 'undefined' && navigator && /Win/i.test(navigator.platform);
+const isMacLike = typeof window !== 'undefined' && navigator && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
21
22
export interface EditorProps {
23
lineNumbers: boolean;
0 commit comments