Added title casing
This commit is contained in:
8
main.ts
8
main.ts
@@ -37,9 +37,11 @@ async function fetchPages(pages: string[], bot: Mwn): Promise<VideoDescription[]
|
||||
parseSummary(await new bot.Page(v).text(), v)
|
||||
))
|
||||
|
||||
d.map((v, index) => ({ r: v, source: pages[index] })).filter((v): v is { source: string, r: PromiseRejectedResult } => v.r.status === "rejected").forEach(
|
||||
v => console.warn(`Error parsing ${v.source}: ${v.r.reason}`
|
||||
))
|
||||
d.map((v, index) => ({ r: v, source: pages[index] }))
|
||||
.filter((v): v is { source: string, r: PromiseRejectedResult } => v.r.status === "rejected")
|
||||
.forEach(
|
||||
v => console.warn(`Error parsing ${v.source}: ${v.r.reason}`
|
||||
))
|
||||
|
||||
return d.filter(v => v.status === "fulfilled").map(v => v.value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user