Skip to content

Commit

Permalink
style(eslint): fix issues reported by linter
Browse files Browse the repository at this point in the history
  • Loading branch information
parfeon committed Oct 31, 2024
1 parent 0f0648f commit 78e6771
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 120 deletions.
171 changes: 57 additions & 114 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
"@types/sinon": "^17.0.3",
"@types/text-encoding": "^0.0.39",
"@types/underscore": "^1.11.15",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"chai": "^4.4.1",
"chai-as-promised": "^7.1.1",
"chai-nock": "^1.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/core/endpoints/presence/here_now.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class HereNowRequest extends AbstractRequest<Presence.HereNowResponse> {

return {
...(!includeUUIDs! ? { disable_uuids: '1' } : {}),
...(includeState ?? false ? { state: '1' } : {}),
...((includeState ?? false) ? { state: '1' } : {}),
...(channelGroups && channelGroups.length > 0 ? { 'channel-group': channelGroups.join(',') } : {}),
...queryParameters!,
};
Expand Down
1 change: 0 additions & 1 deletion src/core/pubnub-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,6 @@ export default class PubNubObjects {
uuids:
spaceParameters.users?.map((user) => {
if (typeof user === 'string') return user;
user.userId;
return { id: user.userId, custom: user.custom };
}) ?? spaceParameters.uuids,
limit: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const encodeString = (input: string | number) => {
*/
export const encodeNames = (names: string[], defaultString?: string) => {
const encodedNames = names.map((name) => encodeString(name));
return encodedNames.length ? encodedNames.join(',') : defaultString ?? '';
return encodedNames.length ? encodedNames.join(',') : (defaultString ?? '');
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/event-engine/states/handshake_failed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ HandshakeFailedState.on(restore.type, (context, event) =>
groups: event.payload.groups,
cursor: {
timetoken: event.payload.cursor.timetoken,
region: event.payload.cursor.region ? event.payload.cursor.region : context?.cursor?.region ?? 0,
region: event.payload.cursor.region ? event.payload.cursor.region : (context?.cursor?.region ?? 0),
},
}),
);
Expand Down

0 comments on commit 78e6771

Please sign in to comment.