forked from FoundKeyGang/FoundKey
Fix types in summaly connector
This commit is contained in:
parent
79c71bf22a
commit
9f3b85527d
1 changed files with 3 additions and 3 deletions
|
@ -31,7 +31,7 @@ export const urlPreviewHandler = async (ctx: Koa.Context): Promise<void> => {
|
|||
const summary = meta.summalyProxy ? await getJson(`${meta.summalyProxy}?${query({
|
||||
url,
|
||||
lang: lang ?? 'ja-JP',
|
||||
})}`) : await summaly.default(url, {
|
||||
})}`) as Awaited<ReturnType<typeof summaly.default>> : await summaly.default(url, {
|
||||
followRedirects: false,
|
||||
lang: lang ?? 'ja-JP',
|
||||
});
|
||||
|
@ -53,8 +53,8 @@ export const urlPreviewHandler = async (ctx: Koa.Context): Promise<void> => {
|
|||
}
|
||||
};
|
||||
|
||||
function wrap(url?: string): string | null {
|
||||
return url != null
|
||||
function wrap(url: string|null): string|null {
|
||||
return url !== null
|
||||
? url.match(/^https?:\/\//)
|
||||
? `${config.url}/proxy/preview.webp?${query({
|
||||
url,
|
||||
|
|
Loading…
Reference in a new issue