Skip to content

Commit 048b1de

Browse files
fix: fix ts errors
1 parent 1276e52 commit 048b1de

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/lib/adopted-probes.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ type AdoptedProbe = {
1414
}
1515

1616
export class AdoptedProbes {
17-
private adoptedProbesByIp: Map<AdoptedProbe['ip'], Omit<AdoptedProbe, 'ip'>> = new Map();
1817
private connectedIpToUuid: Map<string, string> = new Map();
1918
private connectedUuidToIp: Map<string, string> = new Map();
2019

@@ -37,7 +36,6 @@ export class AdoptedProbes {
3736
this.connectedUuidToIp = new Map(allSockets.map(socket => [ socket.data.probe.uuid, socket.data.probe.ipAddress ]));
3837

3938
const adoptedProbes = await this.sql(TABLE_NAME).select<AdoptedProbe[]>('ip', 'uuid', 'lastSyncDate');
40-
this.adoptedProbesByIp = new Map(adoptedProbes.map(({ ip, uuid, lastSyncDate }) => [ ip, { uuid, lastSyncDate }]));
4139
await Promise.all(adoptedProbes.map(({ ip, uuid }) => this.syncProbeIds(ip, uuid)));
4240
await Promise.all(adoptedProbes.map(({ ip, lastSyncDate }) => this.updateSyncDate(ip, lastSyncDate)));
4341
}

test/tests/unit/adopted-probes.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'chai';
2-
import { Knex } from 'knex';
2+
import type { Knex } from 'knex';
33
import * as sinon from 'sinon';
44
import { AdoptedProbes } from '../../../src/lib/adopted-probes.js';
55

test/tests/unit/middleware/only-admin.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ beforeEach(() => {
1313
describe('rate limit middleware', () => {
1414
it('should reject requests with "isAdmin" false', async () => {
1515
const ctx = { isAdmin: false } as unknown as Context;
16-
const err = await onlyAdmin()(ctx, next).catch(err => err);
16+
const err = await onlyAdmin()(ctx, next).catch((err: unknown) => err);
1717
expect(err).to.deep.equal(createHttpError(403, 'Forbidden', { type: 'access_forbidden' }));
1818
expect(next.callCount).to.equal(0);
1919
});

0 commit comments

Comments
 (0)