function htmlParser(html, filePath) {
    let index;
    let output;
    let injectHTML;
    let projectHTML;
    try {
        projectHTML = fs_1.default.readFileSync(filePath + 'index.html').toString('utf8');
        injectHTML = html.split(',').join('\n'); // split the refernces and place them in new lines
        index = projectHTML.indexOf('<head>') + 6; // get the index right  after the head tag
        if (!projectHTML.replace(/\s+/g, '').includes(injectHTML.replace(/\s+/g, ''))) {
            // insert the refernces into the projects html
            output = [projectHTML.slice(0, index), injectHTML, projectHTML.slice(index)].join('\n');
            fs_1.default.writeFileSync(filePath + 'index.html', beautify(output));
        }
    }
    catch (err) {
        console.log(err);
    }
}
/**
 * Description: Parses the HTML file and injects the necessary tags to reference all generated files
 * @param html - metadata extracted from the generated html
 * @param path - path to the index.html file
 */
Parses the HTML file and injects the necessary tags to reference all generated files
@param html - metadata extracted from the generated html
@param path - path to the index.html file
Parses the HTML file and injects the necessary tags to reference all generated files @param html - metadata extracted from the generated html @param path - path to the index . html file
function htmlParser(html, filePath) {
    let index;
    let output;
    let injectHTML;
    let projectHTML;
    try {
        projectHTML = fs_1.default.readFileSync(filePath + 'index.html').toString('utf8');
        injectHTML = html.split(',').join('\n'); 
        index = projectHTML.indexOf('<head>') + 6; 
        if (!projectHTML.replace(/\s+/g, '').includes(injectHTML.replace(/\s+/g, ''))) {
            output = [projectHTML.slice(0, index), injectHTML, projectHTML.slice(index)].join('\n');
            fs_1.default.writeFileSync(filePath + 'index.html', beautify(output));
        }
    }
    catch (err) {
        console.log(err);
    }
}
function htmlParser ( html , filePath ) { let index ; let output ; let injectHTML ; let projectHTML ; try { projectHTML = fs_1 . default . readFileSync ( filePath + 'index.html' ) . toString ( 'utf8' ) ; injectHTML = html . split ( ',' ) . join ( '\n' ) ; index = projectHTML . indexOf ( '<head>' ) + 6 ; if ( ! projectHTML . replace ( / \s+ / g , '' ) . includes ( injectHTML . replace ( / \s+ / g , '' ) ) ) { output = [ projectHTML . slice ( 0 , index ) , injectHTML , projectHTML . slice ( index ) ] . join ( '\n' ) ; fs_1 . default . writeFileSync ( filePath + 'index.html' , beautify ( output ) ) ; } } catch ( err ) { console . log ( err ) ; } }
Description: Parses the HTML file and injects the necessary tags to reference all generated files
 @param html - metadata extracted from the generated html
 @param path - path to the index.html file
Description : Parses the HTML file and injects the necessary tags to reference all generated files @param html - metadata extracted from the generated html @param path - path to the index . html file
// split the refernces and place them in new lines // get the index right  after the head tag // insert the refernces into the projects html