[gnome-maps/wip/mlundblad/simplify-place-init] place: Use Object.assign() to assign place parameter
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/simplify-place-init] place: Use Object.assign() to assign place parameter
- Date: Fri, 30 Oct 2020 22:14:55 +0000 (UTC)
commit fab54471cef862c7270273993260d2548850ecf7
Author: Marcus Lundblad <ml update uu se>
Date: Fri Oct 30 23:13:49 2020 +0100
place: Use Object.assign() to assign place parameter
src/place.js | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
---
diff --git a/src/place.js b/src/place.js
index 675e3320..54b89630 100644
--- a/src/place.js
+++ b/src/place.js
@@ -106,29 +106,10 @@ class Place extends Geocode.Place {
delete params.wheelchair;
if (params.place) {
- params = { osm_id: params.place.osm_id,
- osm_type: params.place.osm_type,
- name: params.place.name,
- location: params.place.location,
- bounding_box: params.place.bounding_box,
- place_type: params.place.place_type,
- street_address: params.place.street_address,
- street: params.place.street,
- building: params.place.building,
- postal_code: params.place.postal_code,
- area: params.place.area,
- town: params.place.town,
- state: params.place.state,
- county: params.place.county,
- country: params.place.country,
- country_code: params.place.contry_code,
- continent: params.place.continent };
+ Object.assign(params.place, this);
+ delete params.place;
}
- for (let prop in params)
- if (!params[prop])
- delete params[prop];
-
super._init(params);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]