async getAddress(locationObject) { const cacheKey = `${String(+locationObject.lat.toFixed(3))}-${String(+locationObject.lon.toFixed(3))}` const cachedResult = geoCache.getKey(cacheKey) if (cachedResult) return cachedResult try { const geocoder = this.getGeocoder() const [result] = await geocoder.reverse(locationObject) const flag = emojiFlags[result.countryCode] const addressDts = this.mustache.compile(this.config.locale.addressFormat) result.addr = addressDts(result) result.flag = flag ? flag.emoji : '' geoCache.setKey(cacheKey, result) geoCache.save(true) return result } catch (err) { throw new Error({ source: 'getAddress', error: err }) } }
return fetch_starred_repos(options, pages) .then((data) => { cache.setKey('data', data); cache.save(); return data;