Skip to content

Commit 84fa6be

Browse files
authored
Merge pull request #3175 from dsanders11/patch-1
use Array.includes
2 parents 5f4b719 + af2f744 commit 84fa6be

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/common/Platform.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,8 @@ export const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
2323
// Find the users platform. We use this to interpret the meta key
2424
// and ISO third level shifts.
2525
// http://stackoverflow.com/q/19877924/577598
26-
export const isMac = contains(['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'], platform);
26+
export const isMac = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'].includes(platform);
2727
export const isIpad = platform === 'iPad';
2828
export const isIphone = platform === 'iPhone';
29-
export const isWindows = contains(['Windows', 'Win16', 'Win32', 'WinCE'], platform);
29+
export const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(platform);
3030
export const isLinux = platform.indexOf('Linux') >= 0;
31-
32-
/**
33-
* Return if the given array contains the given element
34-
* @param arr The array to search for the given element.
35-
* @param el The element to look for into the array
36-
*/
37-
function contains(arr: any[], el: any): boolean {
38-
return arr.indexOf(el) >= 0;
39-
}

0 commit comments

Comments
 (0)