Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

453 B
Raw Blame
import {
  ArchivedFormat,
  LinkIncludingShortenedCollectionAndTags,
} from "@linkwarden/types/global";

const getOriginalFormat = (
  link: LinkIncludingShortenedCollectionAndTags
): ArchivedFormat | null => {
  if (link.type === "pdf") return ArchivedFormat.pdf;
  else if (link.type === "image")
    return link.image?.endsWith("png")
      ? ArchivedFormat.png
      : ArchivedFormat.jpeg;
  else return null;
};

export default getOriginalFormat;