import { Howl } from 'howler' ; export const isLegal = ( val ) : boolean => /^[a-z_A-Z_._(_)_0-9'!,='?\-;[\]\\/]$/ . test ( val ) ; export const isChineseSymbol = ( val ) : boolean => /[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/ . test ( val ) ; export const IsDesktop = ( ) => { const userAgentInfo = navigator . userAgent ; const Agents = [ 'Android' , 'iPhone' , 'SymbianOS' , 'Windows Phone' , 'iPad' , 'iPod' ] ; let flag = true ; for ( let v = 0 ; v < Agents . length ; v ++ ) { if ( userAgentInfo . indexOf ( Agents [ v ] ) > 0 ) { flag = false ; break ; } } return flag ; } ; export function addHowlListener ( howl , ... args ) { howl . on ( ... args ) ; return ( ) => howl . off ( ... args ) ; } export function classNames ( ... classNames ) { const finallyClassNames = [ ] ; for ( const className of classNames ) { if ( className ) { finallyClassNames . push ( className . trim ( ) ) ; } } return finallyClassNames . join ( ' ' ) ; }