Add loader and new formats
Some checks failed
Bump deps (only minor versions) / ci (push) Failing after 11s

This commit is contained in:
0d0 2025-02-23 04:55:09 +01:00
parent 204bceeee3
commit dcb7cfec27
6 changed files with 148 additions and 40 deletions

14
src/lib/server/helpers.ts Normal file
View file

@ -0,0 +1,14 @@
import formats from '$lib/common/supportedFormats.json';
const formatMime = new Map(Object.entries(formats))
export const mimeTypeMap = formatMime;
export const contentTypeFromFormat = (format: string): string => {
const toReturn: string | undefined = formatMime.get(format)
if (!toReturn) {
throw new Error("Unsupported format")
}
return toReturn;
}