UNPKG

@lucidcms/core

Version:

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

2 lines 564 B
const e=(e,t)=>e?.find(e=>e.localeCode===t)?.value,t=(e,t,n)=>e===void 0?[]:t.i18n.locales.map(t=>({localeCode:t.code,value:n.forLocale(t.code)(e)??null})),n=e=>{let t=new Set;for(let n of e)for(let e of n??[])e.localeCode!==null&&t.add(e.localeCode);return t},r=t=>{let r=n([t.name,t.description]);return Array.from(r).map(n=>({role_id:t.roleId,locale_code:n,name:e(t.name,n)??null,description:e(t.description,n)??null}))};export{e as getTranslationValue,t as normalizeTranslationArray,r as prepareRoleTranslations}; //# sourceMappingURL=role-translations.mjs.map