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




commit 757d2b853044ba38279192e552c66d7a933a82bf
Author: Marcus Lundblad <ml dfupdate se>
Date:   Mon May 23 23:15:27 2022 +0200

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

 src/photonGeocode.js | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/src/photonGeocode.js b/src/photonGeocode.js
index 159db1f1..6065a876 100644
--- a/src/photonGeocode.js
+++ b/src/photonGeocode.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';
 
@@ -153,9 +151,7 @@ export class PhotonGeocode {
         if (this._additionalParams)
             this._additionalParams.forEach((p) => query.add(p.key, p.value));
 
-        return Format.vprintf('%s/%s/?%s', [this._baseUrl,
-                                            string ? 'api' : 'reverse',
-                                            query.toString()]);
+        return `${this._baseUrl}/${string ? 'api' : 'reverse'}/?${query.toString()}`;
     }
 
     _readService() {


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