mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-15 07:17:00 +10:00
a4999c04af
- drop dotenv (Node 24 process.loadEnvFile) and dompurify (only used by dead code) - delete unused ui components/hooks (card, progress, checkbox, use-confirm, use-prompt) - delete dead sanitizeHtml/sanitizeCss, url-security helpers, patch-resume tool, schema/page, createResumePatches, patch-proposal preview builder, fonts fallback helpers - inline single-caller wrappers (flags service, auth getSession, pdf renderer passthrough) - deduplicate template color helpers into shared/color-helpers - unexport 50+ internal-only symbols, remove dead export-map entries - replace hand-rolled unique()/useIsMobile with Set spread and usehooks-ts
22 lines
533 B
TypeScript
22 lines
533 B
TypeScript
import { slugify } from "./string";
|
|
|
|
export function generateFilename(prefix: string, extension?: string) {
|
|
const name = slugify(prefix);
|
|
return `${name}${extension ? `.${extension}` : ""}`;
|
|
}
|
|
|
|
export function downloadWithAnchor(blob: Blob, filename: string) {
|
|
const a = document.createElement("a");
|
|
const url = URL.createObjectURL(blob);
|
|
|
|
a.href = url;
|
|
a.rel = "noopener";
|
|
a.download = filename;
|
|
|
|
document.body.appendChild(a);
|
|
a.click();
|
|
document.body.removeChild(a);
|
|
|
|
setTimeout(() => URL.revokeObjectURL(url), 5000);
|
|
}
|