Member Junction
    Preparing search index...
    • Pure helper that synthesizes a safe download filename from an artifact's name + MIME type. Pulled out as a top-level function (not a class method) so the vitest node-environment unit test can exercise it directly.

      • Strips characters illegal on common filesystems (anything not [A-Za-z0-9._-]) and replaces them with underscores.
      • Picks the extension from IMAGE_MIME_EXTENSION_MAP, defaulting to img if the MIME type is missing or unrecognized.
      • Falls back to the literal image when no name is supplied.

      Parameters

      • name: string | null | undefined

        Artifact name (e.g. "Generated image 1"). Optional.

      • mime: string | null | undefined

        MIME type from the artifact version (e.g. "image/jpeg"). Optional.

      Returns string

      Sanitized filename with extension (e.g. "Generated_image_1.jpg").