import { minify } from 'html-minifier' ; /**
 * HTML Transformer
 */ export class HTMLTransformer { param htmlContent returns public static minify ( htmlContent ) { if ( htmlContent . trim ( ) === '' ) { return '' ; } else { try { return minify ( htmlContent , htmlMinifierConfiguration ) . replace ( /[\n\r]\s*/gm , ' ' ) . replace ( /'/g , "\'" ) ; } catch ( error ) { throw new Error ( 'HTML Parser: Parse error, the HTML seems to be invalid.' ) ; } } } } /**
 * HTML Minifier Configuration
 */ export const htmlMinifierConfiguration = { caseSensitive : true , collapseBooleanAttributes : true , collapseInlineTagWhitespace : true , collapseWhitespace : true , conservativeCollapse : false , decodeEntities : true , html5 : true , keepClosingSlash : false , maxLineLength : false , preserveLineBreaks : false , preventAttributesEscaping : false , processConditionalComments : false , quoteCharacter : '"' , removeAttributeQuotes : false , removeComments : true , removeEmptyAttributes : true , removeEmptyElements : false , removeOptionalTags : true , removeRedundantAttributes : true , removeScriptTypeAttributes : true , removeStyleLinkTypeAttributes : true , removeTagWhitespace : false , sortAttributes : true , sortClassName : true , trimCustomFragments : false , useShortDoctype : true } ;