From 094edc5d563cefc587cb7eef89cd9c8b77d0adcd Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 17 Jan 2021 23:34:54 -0500 Subject: [PATCH] Fix lint --- commands/search/country.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/commands/search/country.js b/commands/search/country.js index 79234293..19bd31d9 100644 --- a/commands/search/country.js +++ b/commands/search/country.js @@ -32,11 +32,12 @@ module.exports = class CountryCommand extends Command { try { const { body } = await request.get(`https://restcountries.eu/rest/v2/name/${encodeURIComponent(query)}`); const data = body.find(country => { - return country.name.toLowerCase() === query.toLowerCase() - || country.altSpellings.some(alt => alt.toLowerCase() === query.toLowerCase()) - || country.alpha2Code.toLowerCase() === query.toLowerCase() - || country.alpha3Code.toLowerCase() === query.toLowerCase() - || country.nativeName.toLowerCase() === query.toLowerCase() + const search = query.toLowerCase(); + return country.name.toLowerCase() === search + || country.altSpellings.some(alt => alt.toLowerCase() === search) + || country.alpha2Code.toLowerCase() === search + || country.alpha3Code.toLowerCase() === search + || country.nativeName.toLowerCase() === search }) || body[0]; const embed = new MessageEmbed() .setColor(0x00AE86)