diff --git a/lib/summarize/summarizeComponentDefinition.js b/lib/summarize/summarizeComponentDefinition.js index 99ea2526..33f7431f 100644 --- a/lib/summarize/summarizeComponentDefinition.js +++ b/lib/summarize/summarizeComponentDefinition.js @@ -77,10 +77,10 @@ function summarizeComponentDefinition (componentDefinition, req, sbol, remote, g } function sortTypes (a, b) { - if ((a.description && !b.description) || - (!a.description && !b.description && a.uri.toLowerCase() < b.uri.toLowerCase()) || - (a.description && b.description && a.description.name.toLowerCase() < b.description.name.toLowerCase()) || - (a.description && b.description && a.description.name.toLowerCase() === b.description.name.toLowerCase() && a.uri.toLowerCase() < b.uri.toLowerCase())) { + if ((a.description.name && !b.description.name) || + (!a.description.name && !b.description.name && a.uri.toLowerCase() < b.uri.toLowerCase()) || + (a.description.name && b.description.name && a.description.name.toLowerCase() < b.description.name.toLowerCase()) || + (a.description.name && b.description.name && a.description.name.toLowerCase() === b.description.name.toLowerCase() && a.uri.toLowerCase() < b.uri.toLowerCase())) { return -1 } else { return 1 diff --git a/lib/type.js b/lib/type.js index 60e71895..93fab7a8 100644 --- a/lib/type.js +++ b/lib/type.js @@ -29,7 +29,7 @@ function lookupType (uri) { return { uri: uri, term: uri, - description: uri + description: { name: uri } } }