File tree 3 files changed +7
-2
lines changed
3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ function getPlatformFromUserAgent (ua) {
34
34
// aix darwin freebsd linux openbsd sunos win32
35
35
if ( / m a c / i. test ( name ) ) { return 'darwin' }
36
36
if ( / w i n d o w s / i. test ( name ) ) { return 'win32' }
37
- if ( / u b u n t u | l i n u x | g e n t o o | c e n t o s | r e d h a t | s u s e | u n i x / i. test ( name ) ) { return 'linux' }
37
+ if ( / u b u n t u | l i n u x | g e n t o o | c e n t o s | r e d h a t | s u s e | u n i x | f e d o r a / i. test ( name ) ) { return 'linux' }
38
38
if ( / f r e e b s d / i. test ( name ) ) { return 'freebsd' }
39
39
if ( / o p e n b s d / i. test ( name ) ) { return 'openbsd' }
40
40
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ function getPlatformFromUserAgent (ua) {
34
34
// aix darwin freebsd linux openbsd sunos win32
35
35
if ( / m a c / i. test ( name ) ) return 'darwin'
36
36
if ( / w i n d o w s / i. test ( name ) ) return 'win32'
37
- if ( / u b u n t u | l i n u x | g e n t o o | c e n t o s | r e d h a t | s u s e | u n i x / i. test ( name ) ) return 'linux'
37
+ if ( / u b u n t u | l i n u x | g e n t o o | c e n t o s | r e d h a t | s u s e | u n i x | f e d o r a / i. test ( name ) ) return 'linux'
38
38
if ( / f r e e b s d / i. test ( name ) ) return 'freebsd'
39
39
if ( / o p e n b s d / i. test ( name ) ) return 'openbsd'
40
40
Original file line number Diff line number Diff line change @@ -57,6 +57,11 @@ describe('getPlatformFromUserAgent', () => {
57
57
getPlatformFromUserAgent ( ua ) . should . eq ( 'linux' )
58
58
} )
59
59
60
+ it ( 'returns `linux` for Fedora' , ( ) => {
61
+ const ua = 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0'
62
+ getPlatformFromUserAgent ( ua ) . should . eq ( 'linux' )
63
+ } )
64
+
60
65
it ( 'returns `win32` for Windows' , ( ) => {
61
66
const ua = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.71 (KHTML like Gecko) WebVideo/1.0.1.10 Version/7.0 Safari/537.71'
62
67
getPlatformFromUserAgent ( ua ) . should . eq ( 'win32' )
You can’t perform that action at this time.
0 commit comments