import { map } from '../utilities'; const headProperty = ({ key, value }) => ` ${key}="${value}"`; const headTag = ({ key, value }) => { const child = value.child || ''; delete value.child; return `<${key}${map(value) .map(headProperty) .join('')}>${child}`; }; const headT = head => map(head).map(headTag); const doc = (head, style, body, additions) => ` ${headT(head).join('\n')} ${style} ${body} ${additions} `; export default doc;