MCPcopy
hub / github.com/audreyt/ethercalc / deriveFilename

Function deriveFilename

packages/client/src/boot.ts:171–176  ·  view source on GitHub ↗
(url: string, cd: string | null)

Source from the content-addressed store, hash-verified

169 // four formats (xlsx/ods are binary, csv/html are text) and
170 // honors the server's Content-Disposition filename.
171 const deriveFilename = (url: string, cd: string | null): string => {
172 const match = cd && /filename\*?="?([^";]+)"?/i.exec(cd);
173 if (match?.[1]) return match[1];
174 const tail = url.split('?')[0]?.split('/').pop() ?? 'export';
175 return tail;
176 };
177 const open =
178 host.__exportOpen ??
179 (typeof document !== 'undefined' && typeof fetch !== 'undefined'

Callers 1

openLegacyExportDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected