packages/renderer/assetsToHeaders.js
// that can be included in the HEAD tag.
that can be included in the HEAD tag.
that can be included in the HEAD tag .
function assetsToHeaders(pluginAssets, options = null) {
	options = Object.assign({}, { asHtml: false }, options);
	const headers = {};
	for (let i = 0; i < pluginAssets.length; i++) {
		const asset = pluginAssets[i];
		if (asset.mime === 'text/css') {
			headers[asset.name] = `<link rel="stylesheet" href="pluginAssets/${asset.name}">`;
		} else if (asset.mime === 'application/javascript') {
			headers[asset.name] = `<script type="application/javascript" src="pluginAssets/${asset.name}"></script>`;
		}
	}
	if (options.asHtml) {
		const output = [];
		for (const name in headers) {
			output.push(headers[name]);
		}
		return output.join('');
	}
	return headers;
}
function assetsToHeaders ( pluginAssets , options = null ) { options = Object . assign ( { } , { asHtml : false } , options ) ; const headers = { } ; for ( let i = 0 ; i < pluginAssets . length ; i ++ ) { const asset = pluginAssets [ i ] ; if ( asset . mime === 'text/css' ) { headers [ asset . name ] = ` ${ asset . name } ` ; } else if ( asset . mime === 'application/javascript' ) { headers [ asset . name ] = ` ${ asset . name } ` ; } } if ( options . asHtml ) { const output = [ ] ; for ( const name in headers ) { output . push ( headers [ name ] ) ; } return output . join ( '' ) ; } return headers ; }
that can be included in the HEAD tag.
that can be included in the HEAD tag .
// NOT TESTED!!