Merge branch '2.0.0-ts' of https://github.com/MillenniumEarl/F95API into 2.0.0-ts

pull/81/head
MillenniumEarl 2021-03-04 12:05:46 +01:00
commit bee130b3b9
2 changed files with 4 additions and 4 deletions

View File

@ -19,11 +19,11 @@ import { IQuery } from "../interfaces.js";
export default async function getURLsFromQuery(query: IQuery, limit: number = 30): Promise<string[]> { export default async function getURLsFromQuery(query: IQuery, limit: number = 30): Promise<string[]> {
switch (query.itype) { switch (query.itype) {
case "HandiworkSearchQuery": case "HandiworkSearchQuery":
return await fetchHandiworkURLs(query as HandiworkSearchQuery, limit); return fetchHandiworkURLs(query as HandiworkSearchQuery, limit);
case "LatestSearchQuery": case "LatestSearchQuery":
return await fetchLatestHandiworkURLs(query as LatestSearchQuery, limit); return fetchLatestHandiworkURLs(query as LatestSearchQuery, limit);
case "ThreadSearchQuery": case "ThreadSearchQuery":
return await fetchThreadHandiworkURLs(query as ThreadSearchQuery, limit); return fetchThreadHandiworkURLs(query as ThreadSearchQuery, limit);
default: default:
throw Error(`Invalid query type: ${query.itype}`); throw Error(`Invalid query type: ${query.itype}`);
} }