diff --git a/app/index.js b/app/index.js index 2054df0..578dfdc 100644 --- a/app/index.js +++ b/app/index.js @@ -119,17 +119,16 @@ module.exports.getGameData = async function (name, mod) { } // Gets the search results of the game/mod being searched for - let urls = []; - if(mod) urls = await searcher.searchMod(name); - else urls = await searcher.searchGame(name); + const urls = mod ? + await searcher.searchMod(name) : + await searcher.searchGame(name); // Process previous partial results const results = []; for (const url of urls) { // Start looking for information const info = await scraper.getGameInfo(url); - if(!info) continue; - results.push(info); + if (info) results.push(info); } return results; }; diff --git a/app/scripts/classes/credentials.js b/app/scripts/classes/credentials.js index 3041f03..b35c6c8 100644 --- a/app/scripts/classes/credentials.js +++ b/app/scripts/classes/credentials.js @@ -10,6 +10,10 @@ class Credentials { this.token = null; } + /** + * @public + * Fetch and save the token used to log in to F95Zone. + */ async fetchToken() { this.token = await getF95Token(); } diff --git a/app/scripts/classes/prefix-parser.js b/app/scripts/classes/prefix-parser.js index ca81bfe..fb3b9df 100644 --- a/app/scripts/classes/prefix-parser.js +++ b/app/scripts/classes/prefix-parser.js @@ -29,9 +29,6 @@ class PrefixParser { * @returns {String[]} */ _toUpperCaseArray(a) { - // If the array is empty, return - if (a.length === 0) return []; - /** * Makes a string uppercase. * @param {String} s