mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: 🚨 Remove unnecessary async keywords
This commit is contained in:
parent
132bec4d5b
commit
b1d8595a7c
10 changed files with 38 additions and 39 deletions
|
|
@ -395,8 +395,8 @@ export const setContextFormDataToObject = (
|
|||
setTo: object,
|
||||
): Context => {
|
||||
context.req.bodyCache.json = setTo;
|
||||
context.req.parseBody = async () => context.req.bodyCache.json;
|
||||
context.req.json = async () => context.req.bodyCache.json;
|
||||
context.req.parseBody = () => Promise.resolve(context.req.bodyCache.json);
|
||||
context.req.json = () => Promise.resolve(context.req.bodyCache.json);
|
||||
|
||||
return context;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -47,11 +47,11 @@ export const urlToContentFormat = (url?: string): ContentFormat | null => {
|
|||
};
|
||||
};
|
||||
|
||||
export const mimeLookup = async (url: string) => {
|
||||
export const mimeLookup = (url: string): Promise<string> => {
|
||||
const naiveLookup = lookup(url.replace(new URL(url).search, ""));
|
||||
|
||||
if (naiveLookup) {
|
||||
return naiveLookup;
|
||||
return Promise.resolve(naiveLookup);
|
||||
}
|
||||
|
||||
const fetchLookup = fetch(url, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue