Sha256: a2fa810e5e81282fb797ad59590fe3f0c6e4d0e013aa7e0b654dec35ac91723a
Contents?: true
Size: 1 KB
Versions: 14
Compression:
Stored size: 1 KB
Contents
((exports) => { // If you want to customize the geocoder address format which is displayed // when showing the geocoding results list, add this configuration code to // your geocoder at config/initializers/decidim.rb: // config.maps = { // # ... other configs ... // autocomplete: { // address_format: [%w(street houseNumber), "city", "country"] // } // } // // For the available address keys, refer to the provider's own documentation. const compact = (items) => items.filter( (part) => part !== null && typeof part !== "undefined" && `${part}`.trim().length > 0 ); const formatAddress = (object, keys, separator = ", ") => { const parts = keys.map((key) => { if (Array.isArray(key)) { return formatAddress(object, key, " "); } return object[key] || object[key.toLowerCase()]; }) return compact(parts).join(separator).trim(); } exports.Decidim = exports.Decidim || {}; exports.Decidim.geocodingFormatAddress = formatAddress; })(window);
Version data entries
14 entries across 14 versions & 1 rubygems