Skip to content

Commit c4f076b

Browse files
Fix Lint
1 parent ea903a6 commit c4f076b

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

packages/firestore/src/index/index_entry.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@ export class IndexEntry {
2424
) {}
2525
}
2626

27-
export function indexEntryComparator(left: IndexEntry, right: IndexEntry) {
27+
export function indexEntryComparator(
28+
left: IndexEntry,
29+
right: IndexEntry
30+
): number {
2831
let cmp = left.indexId - right.indexId;
29-
if (cmp != 0) {
32+
if (cmp !== 0) {
3033
return cmp;
3134
}
3235

3336
cmp = DocumentKey.comparator(left.documentKey, right.documentKey);
34-
if (cmp != 0) {
37+
if (cmp !== 0) {
3538
return cmp;
3639
}
3740

3841
cmp = compareByteArrays(left.arrayValue, right.arrayValue);
39-
if (cmp != 0) {
42+
if (cmp !== 0) {
4043
return cmp;
4144
}
4245

packages/firestore/src/util/sorted_set.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export function diffSortedSets<T>(
212212
comparator: (l: T, r: T) => number,
213213
onAdd: (entry: T) => void,
214214
onRemove: (entry: T) => void
215-
) {
215+
): void {
216216
const beforeIt = before.getIterator();
217217
const afterIt = after.getIterator();
218218

packages/firestore/test/unit/local/index_manager.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,24 +235,24 @@ describe('IndexedDbIndexManager', () => {
235235
);
236236
});
237237

238-
it('adds documents', () => {
239-
indexManager.addFieldIndex(
238+
it('adds documents', async () => {
239+
await indexManager.addFieldIndex(
240240
fieldIndex('coll', { fields: [['exists', IndexKind.ASCENDING]] })
241241
);
242-
addDoc('coll/doc1', { 'exists': 1 });
243-
addDoc('coll/doc2', {});
242+
await addDoc('coll/doc1', { 'exists': 1 });
243+
await addDoc('coll/doc2', {});
244244
});
245245

246-
function addDocs(...docs: Document[]) {
246+
function addDocs(...docs: Document[]): Promise<void> {
247247
let data = documentMap();
248248
for (const doc of docs) {
249249
data = data.insert(doc.key, doc);
250250
}
251-
indexManager.updateIndexEntries(data);
251+
return indexManager.updateIndexEntries(data);
252252
}
253253

254-
function addDoc(key: string, data: JsonObject<unknown>) {
255-
addDocs(doc(key, 1, data));
254+
function addDoc(key: string, data: JsonObject<unknown>): Promise<void> {
255+
return addDocs(doc(key, 1, data));
256256
}
257257
});
258258

0 commit comments

Comments
 (0)