Closed svenn71 closed 8 years ago
What we really need is a little unit testing! Thanks for reporting these issues.
I have cloned your repository and started hacking a bit on my own. Found that testing for generic array length > 0 would skip creation of generics if they do not exist in the entity
diff --git a/lib/templates.js b/lib/templates.js
index ad9c748..d146854 100644
--- a/lib/templates.js
+++ b/lib/templates.js
@@ -51,7 +51,7 @@ function componentTemplate(entity) {
function instanceTemplate(entity) {
text = `${entity.name}_i : ${entity.name}\n`
- if (entity.generics) {
+ if (entity.generics > 0) {
text += `generic map (\n`
longest = longestinArray(entity.generics, "name")
for (generic of entity.generics) {
remove the generic part of an entity and there will be no port map generated