import { NativeModules , Platform } from "react-native" ; export const emailIsValid = ( email ) : boolean => /^[^\s@]+@[^\s@]+\.[^\s@]+$/ . test ( email ) ; export const shuffle = < Type > ( array ) : Type [ ] => { let currentIndex = array . length ; let temporaryValue ; let randomIndex ; while ( currentIndex !== 0 ) { randomIndex = Math . floor ( Math . random ( ) * currentIndex ) ; currentIndex -= 1 ; temporaryValue = array [ currentIndex ] ; array [ currentIndex ] = array [ randomIndex ] ; array [ randomIndex ] = temporaryValue ; } return array ; } ; export const scriptHostname = ( ) : string => { const { scriptURL } = NativeModules . SourceCode ; const scriptHostname = scriptURL ?. split ( "://" ) [ 1 ] . split ( ":" ) [ 0 ] ?? "" ; return scriptHostname ; } ; export const isIos = Platform . OS === "ios" ;