UNPKG

@limetech/lime-elements

Version:
1 lines 543 B
import{g as n,a as t,b as o,c as r}from"./p-DlJXKdhK.js";function e(e){const i={id:crypto.randomUUID(),filename:e.name,contentType:e.type,size:e.size,fileContent:e};return i.icon={name:r(i),title:o(i),color:t(i),backgroundColor:n(i)},i}function i(n,t){return void 0===t||"*"===t||t.split(",").map((n=>n.trim())).some((t=>{if(t===n.contentType)return!0;if(t.endsWith("/*")){const o=t.split("/")[0];return n.contentType.startsWith(`${o}/`)}if(t.startsWith(".")){const o=t.split(".")[1];return n.contentType.endsWith(`/${o}`)}}))}export{e as c,i}