Use "No known alternatives." instead of empty section.

This commit is contained in:
Stephen Brown II 2020-09-01 13:11:37 -06:00
parent d27b9885b7
commit b6d883b11d
1 changed files with 2 additions and 1 deletions

View File

@ -105,7 +105,8 @@ function generateServiceSection(data) {
let notes = os.EOL + '';
// If there is data to be displayed, add the start of a Markdown table
let tableHeader = `| Name | Eyes | Description |${os.EOL}| ---- | ---- | ----------- |${os.EOL}`;
if (data.filter(d => "name" in d).length > 0) serviceSection = serviceSection.concat(tableHeader);
if (data.filter(d => 'name' in d).length == 0) tableHeader = `No known alternatives.${os.EOL}`;
serviceSection = serviceSection.concat(tableHeader);
// Iterate over each alternative service and add it to the table
data.forEach(item => {
// If the object has length one, it's either title or note