1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-20 09:58:13 +09:00

fix: type errors

This commit is contained in:
2022-03-09 15:16:54 +09:00
parent 4c256c7c3b
commit 8092ba0903
20 changed files with 70 additions and 69 deletions

View File

@@ -20,10 +20,10 @@ export default async function handler(
const response = await fetch(`https://${query}`);
const availability = response.status === 404;
send(res, { availability });
} catch (err) {
} catch (err: any) {
if ((err as any).code === 'ENOTFOUND') {
return send(res, { availability: true });
}
sendError(res, err as any);
sendError(res, err);
}
}