[CodeFactor] Apply fixes

pull/73/head
codefactor-io 2021-03-04 09:42:41 +00:00
parent ed77fa31f5
commit 8d9d1e11e4
17 changed files with 104 additions and 104 deletions

View File

@ -137,7 +137,7 @@ export async function searchHandiwork<T extends IBasic>(query: HandiworkSearchQu
// Check if the user is logged // Check if the user is logged
if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED); if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED);
return await search<T>(query, limit); return search<T>(query, limit);
}; };
/** /**
@ -155,7 +155,7 @@ export async function getHandiworkFromURL<T extends IBasic>(url: string): Promis
if (!isF95URL(url)) throw new Error(`${url} is not a valid F95Zone URL`); if (!isF95URL(url)) throw new Error(`${url} is not a valid F95Zone URL`);
// Get game data // Get game data
return await getHandiworkInformation<T>(url); return getHandiworkInformation<T>(url);
}; };
/** /**
@ -196,7 +196,7 @@ export async function getLatestUpdates<T extends IBasic>(query: LatestSearchQuer
// Get the data from urls // Get the data from urls
const promiseList = urls.map((u: string) => getHandiworkInformation<T>(u)); const promiseList = urls.map((u: string) => getHandiworkInformation<T>(u));
return await Promise.all(promiseList); return Promise.all(promiseList);
}; };
//#endregion //#endregion

View File

@ -149,7 +149,7 @@ export default class UserProfile extends PlatformUser {
} }
// Wait for the promises to resolve // Wait for the promises to resolve
return await Promise.all(responsePromiseList); return Promise.all(responsePromiseList);
} }
/** /**

View File

@ -74,7 +74,7 @@ export default class LatestSearchQuery implements IQuery {
const decoded = decodeURIComponent(url.toString()); const decoded = decodeURIComponent(url.toString());
// Fetch the result // Fetch the result
return await fetchGETResponse(decoded); return fetchGETResponse(decoded);
} }
public findNearestDate(d: Date): TDate { public findNearestDate(d: Date): TDate {

View File

@ -82,7 +82,7 @@ export default class ThreadSearchQuery implements IQuery {
const params = this.preparePOSTParameters(); const params = this.preparePOSTParameters();
// Return the POST response // Return the POST response
return await fetchPOSTResponse(urls.F95_SEARCH_URL, params); return fetchPOSTResponse(urls.F95_SEARCH_URL, params);
} }
//#endregion Public methods //#endregion Public methods

View File

@ -36,6 +36,6 @@ export default async function executeQuery(query: any, limit: number = 30): Prom
"handiwork"); "handiwork");
// Fetch and return the urls // Fetch and return the urls
return await searchMap[key](query, limit); return searchMap[key](query, limit);
} }
//#endregion //#endregion

View File

@ -25,7 +25,7 @@ export default async function fetchThreadHandiworkURLs(query: ThreadSearchQuery,
const response = await query.execute(); const response = await query.execute();
// Fetch the results from F95 and return the handiwork urls // Fetch the results from F95 and return the handiwork urls
if (response.isSuccess()) return await fetchResultURLs(response.value.data as string, limit); if (response.isSuccess()) return fetchResultURLs(response.value.data as string, limit);
else throw response.value else throw response.value
} }