jsx-slack
Version:
Build JSON object for Slack Block Kit surfaces from JSX
2 lines (1 loc) • 957 B
JavaScript
const{defineProperty:c,create:d,keys:s,freeze:m}=Object,o="$$jsxslack",i=o+"Component",h=(e,r=null,...l)=>{let t=d(null);if(typeof e=="function"){let n={...r||{}},{length:a}=l;a===1?[n.children]=l:a>1&&(n.children=l),t=e(n)}if(t&&typeof t=="object"){for(let n of s(t))t[n]===void 0&&delete t[n];if(!t[o]){let n=l;if(!l.length){let{children:a}=r||{};a!==void 0&&(n=[].concat(a))}c(t,o,{value:{type:e,props:r,children:n}})}}return t},p=(e,r,l={})=>c(r,i,{value:m(c({...l},"name",{value:e,enumerable:!0}))}),u=p("Fragment",({children:e})=>[].concat(e)),y=e=>typeof e=="function"&&!!Object.prototype.hasOwnProperty.call(e,i),f=e=>typeof e=="object"&&!!e&&!!Object.prototype.hasOwnProperty.call(e,o),b=(e,r)=>f(e)&&y(e[o].type)&&(!r||e[o].type===r),j=e=>Array.isArray(e)?[...e]:{...e};export{u as FragmentInternal,j as cleanMeta,p as createComponent,h as createElementInternal,y as isValidComponent,b as isValidElementFromComponent,f as isValidElementInternal};