MCPcopy Index your code
hub / github.com/simstudioai/sim / buildPdfFileName

Function buildPdfFileName

apps/sim/app/api/tools/latex/route.ts:138–142  ·  view source on GitHub ↗

* Builds the output PDF filename: strips any directory components and * normalizes to a single `.pdf` extension.

(fileName: string | undefined)

Source from the content-addressed store, hash-verified

136 * normalizes to a single `.pdf` extension.
137 */
138function buildPdfFileName(fileName: string | undefined): string {
139 const base = (fileName || 'document').split(/[/\\]/).pop()?.trim() || 'document'
140 const withoutExtension = base.toLowerCase().endsWith('.pdf') ? base.slice(0, -4) : base
141 return `${withoutExtension || 'document'}.pdf`
142}
143
144/**
145 * Extracts TeX error lines (lines starting with `!`, each with two lines of

Callers 1

storeCompiledPdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected