We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db6dfc7 commit 969d429Copy full SHA for 969d429
index.js
@@ -27,15 +27,15 @@ function flattenTypeHierarchy(typeHierarchy, assertionsByType) {
27
if (aChildren.length > 0 && bChildren.length === 0) {
28
return 1;
29
}
30
-
31
- if (assertionsByType[a].length > assertionsByType[b].length) {
+ var aLength = assertionsByType[a] ? assertionsByType[a].length : 0;
+ var bLength = assertionsByType[b] ? assertionsByType[b].length : 0;
32
+ if (aLength > bLength) {
33
return -1;
34
- if (assertionsByType[a].length < assertionsByType[b].length) {
35
+ if (aLength < bLength) {
36
37
38
39
a = a.toLowerCase();
40
b = b.toLowerCase();
41
if (a < b) { return -1; }
0 commit comments