mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
Replace eslint and prettier with Biome
This commit is contained in:
parent
4a5a2ea590
commit
af0d627f19
199 changed files with 16493 additions and 16361 deletions
|
|
@ -1,19 +1,21 @@
|
|||
import type { ContentFormat } from "~types/lysand/Object";
|
||||
|
||||
export const getBestContentType = (contents: ContentFormat[]) => {
|
||||
// Find the best content and content type
|
||||
if (contents.find(c => c.content_type === "text/x.misskeymarkdown")) {
|
||||
return (
|
||||
contents.find(c => c.content_type === "text/x.misskeymarkdown") ||
|
||||
null
|
||||
);
|
||||
} else if (contents.find(c => c.content_type === "text/html")) {
|
||||
return contents.find(c => c.content_type === "text/html") || null;
|
||||
} else if (contents.find(c => c.content_type === "text/markdown")) {
|
||||
return contents.find(c => c.content_type === "text/markdown") || null;
|
||||
} else if (contents.find(c => c.content_type === "text/plain")) {
|
||||
return contents.find(c => c.content_type === "text/plain") || null;
|
||||
} else {
|
||||
return contents[0] || null;
|
||||
}
|
||||
// Find the best content and content type
|
||||
if (contents.find((c) => c.content_type === "text/x.misskeymarkdown")) {
|
||||
return (
|
||||
contents.find((c) => c.content_type === "text/x.misskeymarkdown") ||
|
||||
null
|
||||
);
|
||||
}
|
||||
if (contents.find((c) => c.content_type === "text/html")) {
|
||||
return contents.find((c) => c.content_type === "text/html") || null;
|
||||
}
|
||||
if (contents.find((c) => c.content_type === "text/markdown")) {
|
||||
return contents.find((c) => c.content_type === "text/markdown") || null;
|
||||
}
|
||||
if (contents.find((c) => c.content_type === "text/plain")) {
|
||||
return contents.find((c) => c.content_type === "text/plain") || null;
|
||||
}
|
||||
return contents[0] || null;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue