refactor(federation): ⬆️ Use @lysand-org/federation v2.0.0

This commit is contained in:
Jesse Wierzbinski 2024-06-19 13:21:02 -10:00
parent 47ce60494a
commit 70cd00cfa8
No known key found for this signature in database
17 changed files with 56 additions and 60 deletions

View file

@ -1,9 +1,7 @@
import type { EntityValidator } from "@lysand-org/federation";
import type { ContentFormat } from "@lysand-org/federation/types";
import { lookup } from "mime-types";
export const getBestContentType = (
content?: typeof EntityValidator.$ContentFormat,
) => {
export const getBestContentType = (content?: ContentFormat) => {
if (!content) {
return { content: "", format: "text/plain" };
}
@ -24,9 +22,7 @@ export const getBestContentType = (
return { content: "", format: "text/plain" };
};
export const urlToContentFormat = (
url?: string,
): typeof EntityValidator.$ContentFormat | null => {
export const urlToContentFormat = (url?: string): ContentFormat | null => {
if (!url) {
return null;
}