Skip to content

Commit

Permalink
fix: remove global var for Vue 2 (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
tillsanders authored Sep 27, 2021
1 parent 3e951af commit b091366
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vue-prism-editor/src/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const KEYCODE_ESCAPE = 27;
const HISTORY_LIMIT = 100;
const HISTORY_TIME_GAP = 3000;

const isWindows = 'navigator' in global && /Win/i.test(navigator.platform);
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);

export interface EditorProps {
lineNumbers: boolean;
Expand Down

0 comments on commit b091366

Please sign in to comment.