mirror of
https://github.com/sim1222/misskey.git
synced 2025-08-06 00:33:51 +09:00
fix types
This commit is contained in:
@ -97,7 +97,7 @@ async function fetchNodeinfo(instance: Instance): Promise<NodeInfo> {
|
||||
} else {
|
||||
throw e.statusCode || e.message;
|
||||
}
|
||||
});
|
||||
}) as Record<string, unknown>;
|
||||
|
||||
if (wellknown.links == null || !Array.isArray(wellknown.links)) {
|
||||
throw 'No wellknown links';
|
||||
@ -121,7 +121,7 @@ async function fetchNodeinfo(instance: Instance): Promise<NodeInfo> {
|
||||
|
||||
logger.succ(`Successfuly fetched nodeinfo of ${instance.host}`);
|
||||
|
||||
return info;
|
||||
return info as NodeInfo;
|
||||
} catch (e) {
|
||||
logger.error(`Failed to fetch nodeinfo of ${instance.host}: ${e}`);
|
||||
|
||||
@ -142,12 +142,12 @@ async function fetchDom(instance: Instance): Promise<DOMWindow['document']> {
|
||||
return doc;
|
||||
}
|
||||
|
||||
async function fetchManifest(instance: Instance): Promise<Record<string, any> | null> {
|
||||
async function fetchManifest(instance: Instance): Promise<Record<string, unknown> | null> {
|
||||
const url = 'https://' + instance.host;
|
||||
|
||||
const manifestUrl = url + '/manifest.json';
|
||||
|
||||
const manifest = await getJson(manifestUrl);
|
||||
const manifest = await getJson(manifestUrl) as Record<string, unknown>;
|
||||
|
||||
return manifest;
|
||||
}
|
||||
@ -167,7 +167,8 @@ async function fetchFaviconUrl(instance: Instance, doc: DOMWindow['document'] |
|
||||
const faviconUrl = url + '/favicon.ico';
|
||||
|
||||
const favicon = await fetch(faviconUrl, {
|
||||
timeout: 10000,
|
||||
// TODO
|
||||
//timeout: 10000,
|
||||
agent: getAgentByUrl,
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user