Encode and decode geo mapping polyline geometry compressed strings, use typescript validation
$ npm i polyline-decode
import PolylineConvert from 'polyline-decode';
const polylineConvert = new PolylineConvert();
polylineConvert.decode('gflbEcsdtEUXa@f@QZc@`@m@bCYzDOfIEjCEpDMnBCn@E^yBxRGl@Ef@Q`D@hDZ~GZxIp@fPj@`P');
// tuple<number>[]
polylineConvert.encode([35.123456,31.654321]);
// string
Typescript transpile from of https://github.com/jieter/Leaflet.encoded