import type { Coordinates , Bounds } from '../client' ; export function searchParams ( data ) { return Object . keys ( data ) . map ( key => `${ encodeURIComponent ( key ) }=${ encodeURIComponent ( data [ key ] ) }` ) . join ( '&' ) ; } export function coordinatesToString ( coordinates , ordered = false ) { if ( ordered && coordinates . lat < coordinates . lng ) { return `${ coordinates . lng },${ coordinates . lat }` ; } return `${ coordinates . lat },${ coordinates . lng }` ; } export function boundsToString ( bounds , ordered = true ) { return `${ coordinatesToString ( bounds . southwest , ordered ) },${ coordinatesToString ( bounds . northeast , ordered ) }` ; } export function arrayToString ( array ) { return array . join ( ',' ) ; } export function getPlatform ( platform ) { switch ( platform ) { case 'darwin' : return 'Mac OS X' ; case 'win32' : return 'Windows' ; case 'linux' : return 'Linux' ; default : return '' ; } }