config/html-elements-plugin/index.js
function getHtmlElementString(dataSource, publicPath) {
  return Object.getOwnPropertyNames(dataSource)
    .map(function(name) {
      if (Array.isArray(dataSource[name])) {
        return dataSource[name].map(function(attrs) { return createTag(name, attrs, publicPath); } );
      } else {
        return [ createTag(name, dataSource[name], publicPath) ];
      }
    })
    .reduce(function(arr, curr) {
      return arr.concat(curr);
    }, [])
    .join('\n\t');
}
function getHtmlElementString(dataSource, publicPath) {
  return Object.getOwnPropertyNames(dataSource)
    .map(function(name) {
      if (Array.isArray(dataSource[name])) {
        return dataSource[name].map(function(attrs) { return createTag(name, attrs, publicPath); } );
      } else {
        return [ createTag(name, dataSource[name], publicPath) ];
      }
    })
    .reduce(function(arr, curr) {
      return arr.concat(curr);
    }, [])
    .join('\n\t');
}
function getHtmlElementString ( dataSource , publicPath ) { return Object . getOwnPropertyNames ( dataSource ) . map ( function ( name ) { if ( Array . isArray ( dataSource [ name ] ) ) { return dataSource [ name ] . map ( function ( attrs ) { return createTag ( name , attrs , publicPath ) ; } ) ; } else { return [ createTag ( name , dataSource [ name ] , publicPath ) ] ; } } ) . reduce ( function ( arr , curr ) { return arr . concat ( curr ) ; } , [ ] ) . join ( '\n\t' ) ; }
Returns a string representing all html elements defined in a data source.

Example:

const ds = {
link: [
{ rel: "apple-touch-icon", sizes: "57x57", href: "/assets/icon/apple-icon-57x57.png" }
],
meta: [
{ name: "msapplication-TileColor", content: "#00bcd4" }
]
}

getHeadTags(ds);
// "<link rel="apple-touch-icon" sizes="57x57" href="/assets/icon/apple-icon-57x57.png">"
"<meta name="msapplication-TileColor" content="#00bcd4">"

@returns {string}
Returns a string representing all html elements defined in a data source .