release/fillReleaseNotesTemplate.js
/**
 * @param {*} releaseNotes Release notes template text content
 * @returns Release notes where `<HASH>` is replaced with the provided agents package hash
 */
@param {*} releaseNotes Release notes template text content
@returns Release notes where `` is replaced with the provided agents package hash
@param { * } releaseNotes Release notes template text content @returns Release notes where ` ` is replaced with the provided agents package hash
function addHashesToReleaseNotes(releaseNotes) {
    const hashes = util.getHashes();
    const lines = releaseNotes.split('\n');
    const modifiedLines = lines.map((line) => {
        if (!line.includes('<HASH>')) {
            return line;
        }
        const columns = line.split('|').filter((column) => column.length !== 0);
        const packageColumn = columns[1];
        const packageName = packageColumn.substring(packageColumn.indexOf('[') + 1, packageColumn.indexOf(']'));
        return line.replace('<HASH>', hashes[packageName]);
    });
    return modifiedLines.join('\n');
}
function addHashesToReleaseNotes ( releaseNotes ) { const hashes = util . getHashes ( ) ; const lines = releaseNotes . split ( '\n' ) ; const modifiedLines = lines . map ( ( line ) => { if ( ! line . includes ( '<HASH>' ) ) { return line ; } const columns = line . split ( '|' ) . filter ( ( column ) => column . length !== 0 ) ; const packageColumn = columns [ 1 ] ; const packageName = packageColumn . substring ( packageColumn . indexOf ( '[' ) + 1 , packageColumn . indexOf ( ']' ) ) ; return line . replace ( '<HASH>' , hashes [ packageName ] ) ; } ) ; return modifiedLines . join ( '\n' ) ; }
@param {*} releaseNotes Release notes template text content
 @returns Release notes where `<HASH>` is replaced with the provided agents package hash
@param { * } releaseNotes Release notes template text content @returns Release notes where ` <HASH > ` is replaced with the provided agents package hash
// Package is the second column in the releaseNote.md file, get it's value // Inside package column, we have the package name inside the square brackets