UNPKG

@lucidcms/core

Version:

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

2 lines 553 B
import e from"slug";const t=e=>{let t=e.lastIndexOf(`.`);return t<=0?e:e.slice(0,t)},n=n=>{if(!n)return null;let r=n.trim();if(!r)return null;let i=r.split(`/`).pop()?.split(`\\`).pop()??r;return e(t(i),{lower:!0})||null},r=t=>{if(!t)return null;let n=t.trim().replace(/^\.+/,``);return n&&e(n,{lower:!0})||null},i=e=>{let t=n(e.fileName);if(!t)return e.key;let i=r(e.extension),a=i?`${t}.${i}`:t,o=e.key.split(`/`).filter(Boolean);return o.length===0?e.key:[...o,a].join(`/`)};export{i as default}; //# sourceMappingURL=format-media-browser-key.mjs.map