mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(federation): ➕ Replace old types and federation validators with @lysand-org/federation
This commit is contained in:
parent
25d087a54b
commit
5fd6a4e43d
16 changed files with 80 additions and 65 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import type * as Lysand from "lysand-types";
|
||||
import type { EntityValidator } from "@lysand-org/federation";
|
||||
import { lookup } from "mime-types";
|
||||
|
||||
export const getBestContentType = (content?: Lysand.ContentFormat) => {
|
||||
export const getBestContentType = (
|
||||
content?: typeof EntityValidator.$ContentFormat,
|
||||
) => {
|
||||
if (!content) return { content: "", format: "text/plain" };
|
||||
|
||||
const bestFormatsRanked = [
|
||||
|
|
@ -21,7 +23,7 @@ export const getBestContentType = (content?: Lysand.ContentFormat) => {
|
|||
|
||||
export const urlToContentFormat = (
|
||||
url: string,
|
||||
): Lysand.ContentFormat | null => {
|
||||
): typeof EntityValidator.$ContentFormat | null => {
|
||||
if (!url) return null;
|
||||
if (url.startsWith("https://api.dicebear.com/")) {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue