Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Aug 30, 2024
1 parent 6205ee6 commit c44f666
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions __tests__/rate-limit.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { beforeAll, describe, expect, it } from 'vitest';
import { createTestClient } from './create-test-client';
import { StreamClient } from '../src/StreamClient';
import exp from 'constants';

describe('rate limit', () => {
let client: StreamClient;
Expand All @@ -17,8 +16,8 @@ describe('rate limit', () => {
});

expect(response.server_side).toBeDefined();
expect(response.server_side!['QueryChannels']).toBeDefined();
expect(response.server_side!['GetOrCreateChannel']).toBeDefined();
expect(response.server_side!.QueryChannels).toBeDefined();
expect(response.server_side!.GetOrCreateChannel).toBeDefined();
});

it('should get rate limit from response header', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/StreamClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class StreamClient extends CommonApi {
validity_in_seconds?: number;
exp?: number;
iat?: number;
} & { [key: string]: unknown },
} & Record<string, unknown>,
) => {
const defaultIat = Math.floor((Date.now() - 1000) / 1000);
payload.iat = payload.iat ?? defaultIat;
Expand All @@ -111,7 +111,7 @@ export class StreamClient extends CommonApi {
validity_in_seconds?: number;
exp?: number;
iat?: number;
} & { [key: string]: unknown },
} & Record<string, unknown>,
) => {
return this.generateUserToken(payload);
};
Expand Down

0 comments on commit c44f666

Please sign in to comment.