We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf77b77 commit 91e15d8Copy full SHA for 91e15d8
source/SearchIndex/TfIdfSearchIndex.js
@@ -84,12 +84,18 @@ export class TfIdfSearchIndex implements ISearchIndex {
84
}
85
86
if (i === 0) {
87
- for (var uid in tokenMetadata.$uidMap) {
+ var keys = Object.keys(tokenMetadata.$uidMap);
88
+ for (var j = 0, numKeys = keys.length; j < numKeys; j++) {
89
+ var uid = keys[j];
90
+
91
uidToDocumentMap[uid] = tokenMetadata.$uidMap[uid].$document;
92
93
} else {
- for (var uid in uidToDocumentMap) {
- if (!tokenMetadata.$uidMap[uid]) {
94
+ var keys = Object.keys(uidToDocumentMap);
95
96
97
98
+ if (!tokenMetadata.$uidMap.hasOwnProperty(uid)) {
99
delete uidToDocumentMap[uid];
100
101
0 commit comments