UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 527 B
import e from"./normalize-media-key.mjs";const t=e=>Array.from(e,e=>{let t=e.charCodeAt(0);return t<=31||t===127?` `:e}).join(``),n=e=>{let n=e.replace(/\\/g,`/`).split(`/`).filter(Boolean).at(-1)??e;return t(n).replace(/"/g,``).replace(/\s+/g,` `).trim()||`download`},r=t=>{let r=t.fileName?.trim();if(r)return n(r);let i=e(t.key),a=i.split(`/`).filter(Boolean).at(-1)??i;return!t.extension||a.endsWith(`.${t.extension}`)?n(a):n(`${a}.${t.extension}`)};export{r as default}; //# sourceMappingURL=get-download-file-name.mjs.map