UNPKG

@forbespro/lead-agent

Version:
2 lines (1 loc) 576 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(e,l,n){const o=n?n.children:void 0,u=(o?o.indexOf(l):1)===0?"th":"td",i=n&&n.type==="table"?n.align:void 0,g=i?i.length:l.children.length;let r=-1;const a=[];for(;++r<g;){const c=l.children[r],s={},h=i?i[r]:void 0;h&&(s.align=h);let t={type:"element",tagName:u,properties:s,children:[]};c&&(t.children=e.all(c),e.patch(c,t),t=e.applyData(c,t)),a.push(t)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(a,!0)};return e.patch(l,d),e.applyData(l,d)}exports.tableRow=p;