import {IPost} from '../../interfaces'; const getReleaseNotes = (): Promise => { const uri = 'https://raw.githubusercontent.com/equinusocio/vsc-material-theme-releases/master/releases/index.json'; return fetch(uri).then(res => res.json()); }; const renderTemplate = (posts: IPost[]) => { return `${posts.reduce((acc, {version, title, fixed, new: newItems, breaking}) => acc.concat(`
${version}

${title}

`), '')}`; }; getReleaseNotes().then((res: IPost[]) => { document.querySelector('.Container').innerHTML = renderTemplate(res); });