UNPKG

equinox-web-components

Version:

Equinox design for the web using StencilJS

1 lines 505 B
const t=t=>t?t.split(" ").length>=2?t.match(/\b(\w)/g).join(""):t.substr(0,2):"",r=(t,r="unknown")=>{try{return t=t.split(""").join('"'),JSON.parse(t)}catch(o){console.log(t,o),alert(`Error while trying to parse JSON in ${r} component`)}},o=(t,r,e,n=[])=>{let s;if(t&&"object"==typeof t){if(t[r]===e)return n;for(const a of Object.keys(t))if(s=a===r&&t[a]===e?n:o(t[a],r,e,[...n,a]),s)break;return s}},e=(t,r,o)=>r.reduce((t,e,n)=>t[e]=r.length===++n?o:t[e]||{},t);export{r as d,o as f,t as g,e as s}