export function isElectron ( ) { return typeof window !== 'undefined' && typeof window . process === 'object' && ( window . process as any ) . type === 'renderer' ; } export function isValidPort ( value ) { return typeof value === 'number' && value > 1024 && value < 49151 ; }