Skip to content

Commit 997a26d

Browse files
committed
Fix tests and lint errors
1 parent d946b62 commit 997a26d

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

packages/database/src/api/test_access.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ export const queryIdentifier = function(query: Query) {
8383
return query.queryIdentifier();
8484
};
8585

86-
/**
87-
* @param {!Query} firebaseRef
88-
* @return {!Object}
89-
*/
90-
export const listens = function(firebaseRef: Query) {
91-
return (firebaseRef.repo.persistentConnection_ as any).listens_;
92-
};
93-
9486
/**
9587
* Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection.
9688
*

packages/database/test/query.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,10 +1575,11 @@ describe('Query Tests', function() {
15751575
});
15761576

15771577
function dumpListens(node: Query) {
1578-
const listens = (node.repo.persistentConnection_ as any).listens_;
1578+
const listens: Map<string, Map<string, unknown>> = (node.repo
1579+
.persistentConnection_ as any).listens;
15791580
const nodePath = getPath(node);
15801581
const listenPaths = [];
1581-
for (let path in listens) {
1582+
for (let path of listens.keys()) {
15821583
if (path.substring(0, nodePath.length) === nodePath) {
15831584
listenPaths.push(path);
15841585
}
@@ -1588,7 +1589,7 @@ describe('Query Tests', function() {
15881589
const dumpPieces = [];
15891590
for (let i = 0; i < listenPaths.length; i++) {
15901591
const queryIds = [];
1591-
for (let queryId in listens[listenPaths[i]]) {
1592+
for (let queryId of listens.get(listenPaths[i]).keys()) {
15921593
queryIds.push(queryId);
15931594
}
15941595
queryIds.sort();

packages/util/src/obj.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ export function isEmpty(obj: object): obj is {} {
4545
export function map<T extends object, V, U extends { [key in keyof T]: V }>(
4646
obj: T,
4747
fn: (value: Values<T>, key: Keys<T>, obj: T) => V,
48-
opt_obj?: unknown
48+
contextObj?: unknown
4949
): U {
5050
const res: Partial<U> = {};
5151
for (const key in obj) {
5252
if (Object.prototype.hasOwnProperty.call(obj, key)) {
53-
res[key] = fn.call(opt_obj, obj[key], key, obj);
53+
res[key] = fn.call(contextObj, obj[key], key, obj);
5454
}
5555
}
5656
return res as U;

packages/util/src/query.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
* params object (e.g. {arg: 'val', arg2: 'val2'})
2121
* Note: You must prepend it with ? when adding it to a URL.
2222
*/
23-
export function querystring(querystringParams: { [key: string]: string }) {
24-
var params = [];
23+
export function querystring(querystringParams: {
24+
[key: string]: string;
25+
}): string {
26+
const params = [];
2527
for (const [key, value] of Object.entries(querystringParams)) {
2628
if (Array.isArray(value)) {
2729
value.forEach(arrayVal => {

0 commit comments

Comments
 (0)