/** * Converts time in seconds to HH:mm format. * @param time Time to convert in seconds. */exportfunctionsecondsToTimeString(time:number):string{consth=Math.floor(time/3600);constm=Math.floor((time%3600)/60);return`${h<10?`0${h}`:h}:${m<10?`0${m}`:m}`;}/** * Calculates distance between two geographical points. * @param latlng1 Coordinates of the first point. * @param latlng2 Coordinates of the second point. */exportfunctiondistanceBetween(latlng1:number[],latlng2:number[]):number{constR=6371000;constrad=Math.PI/180;constlat1=latlng1[0]*rad;constlat2=latlng2[0]*rad;constsinDLat=Math.sin(((latlng2[0]-latlng1[0])*rad)/2);constsinDLon=Math.sin(((latlng2[1]-latlng1[1])*rad)/2);consta=sinDLat*sinDLat+Math.cos(lat1)*Math.cos(lat2)*sinDLon*sinDLon;constc=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));returnR*c;}exportfunctiongetObjectProperty(object:any,path:string):any{if(object==null){returnobject;}constparts=path.split('.');returnparts.reduce((object,key)=>object?.[key],object);};exportdefault{secondsToTimeString,distanceBetween,getObjectProperty};