BangSo/apps/mobile/lib/artifact-file.ts

7 lines
294 B
TypeScript
Raw Normal View History

2026-09-01 16:51:19 +00:00
import { attachmentExtensionForMimeType } from "@rakazo/core";
export function artifactCacheFileName(artifactId: string, mimeType: string): string {
const safeId = artifactId.replace(/[^A-Za-z0-9_-]/g, "_") || "attachment";
return `${safeId}${attachmentExtensionForMimeType(mimeType)}`;
}