|
7 | 7 | // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced |
8 | 8 | if (!Array.prototype.toSpliced) { |
9 | 9 | // Can't use arrow functions, because we want `this` |
10 | | - Array.prototype.toSpliced = function () { |
| 10 | + Array.prototype.toSpliced = function() { |
11 | 11 | const me = this.slice(); |
12 | 12 | Array.prototype.splice.apply(me, arguments); |
13 | 13 | return me; |
@@ -1185,6 +1185,10 @@ class DocSearch { |
1185 | 1185 | this.searchIndex = this.buildIndex(rawSearchIndex); |
1186 | 1186 | } |
1187 | 1187 |
|
| 1188 | + static getItemType(ty) { |
| 1189 | + return itemTypes[ty]; |
| 1190 | + } |
| 1191 | + |
1188 | 1192 | /** |
1189 | 1193 | * Add an item to the type Name->ID map, or, if one already exists, use it. |
1190 | 1194 | * Returns the number. If name is "" or null, return null (pure generic). |
@@ -3135,9 +3139,9 @@ class DocSearch { |
3135 | 3139 | */ |
3136 | 3140 | const convertNameToId = (elem, isAssocType) => { |
3137 | 3141 | const loweredName = elem.pathLast.toLowerCase(); |
3138 | | - if (typeNameIdMap.has(loweredName) && |
3139 | | - (isAssocType || !typeNameIdMap.get(loweredName).assocOnly)) { |
3140 | | - elem.id = typeNameIdMap.get(loweredName).id; |
| 3142 | + if (this.typeNameIdMap.has(loweredName) && |
| 3143 | + (isAssocType || !this.typeNameIdMap.get(loweredName).assocOnly)) { |
| 3144 | + elem.id = this.typeNameIdMap.get(loweredName).id; |
3141 | 3145 | } else if (!parsedQuery.literalSearch) { |
3142 | 3146 | let match = null; |
3143 | 3147 | let matchDist = maxEditDistance + 1; |
|
0 commit comments