[gnome-maps/wip/mlundblad/es6-modules: 7/24] graphHopperGeocode: Use string templates instead of imports.format




commit 9e469924ccd66b6d437b4a17056ebc60d4566d9d
Author: Marcus Lundblad <ml dfupdate se>
Date:   Mon May 23 23:14:38 2022 +0200

    graphHopperGeocode: Use string templates instead of imports.format
    
    imports.format is deprecated. Use ES string templates instead.

 src/graphHopperGeocode.js | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/src/graphHopperGeocode.js b/src/graphHopperGeocode.js
index b74142c3..ebd06aad 100644
--- a/src/graphHopperGeocode.js
+++ b/src/graphHopperGeocode.js
@@ -19,8 +19,6 @@
  * Author: Marcus Lundblad <ml update uu se>
  */
 
-const Format = imports.format;
-
 import GLib from 'gi://GLib';
 import Soup from 'gi://Soup';
 
@@ -149,8 +147,7 @@ export class GraphHopperGeocode {
         else
             query.add('reverse', 'true');
 
-        return Format.vprintf('%s/api/1/geocode?%s', [this._baseUrl,
-                                                      query.toString()]);
+        return `${this._baseUrl}/api/1/geocode?${query.toString()}`;
     }
 
     _readService() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]