MCPcopy
hub / github.com/linkwarden/linkwarden / formatAvailable

Function formatAvailable

packages/lib/formatStats.ts:4–9  ·  view source on GitHub ↗
(
  link: Link | LinkIncludingShortenedCollectionAndTags,
  format: "image" | "pdf" | "readable" | "monolith" | "preview"
)

Source from the content-addressed store, hash-verified

2import { Link } from "@linkwarden/prisma/client";
3
4export function formatAvailable(
5 link: Link | LinkIncludingShortenedCollectionAndTags,
6 format: "image" | "pdf" | "readable" | "monolith" | "preview"
7) {
8 return Boolean(link && link[format] && link[format] !== "unavailable");
9}
10
11export const atLeastOneFormatAvailable = (
12 link: Link | LinkIncludingShortenedCollectionAndTags

Callers 9

LinkDetailsFunction · 0.90
CardFunction · 0.90
LinkCardFunction · 0.90
LinkFormatsFunction · 0.90
LinkMasonryFunction · 0.90
PreservationNavbarFunction · 0.90
PreservationContentFunction · 0.90
LinkListingFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected