Skip to content

Commit 837af56

Browse files
authored
fix: Remove data conditional check (#11250)
* fix: remove conditional * types: sort types
1 parent e8217e3 commit 837af56

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

packages/discord.js/src/structures/GuildMember.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class GuildMember extends Base {
6161
*/
6262
Object.defineProperty(this, '_roles', { value: [], writable: true });
6363

64-
if (data) this._patch(data);
64+
this._patch(data);
6565
}
6666

6767
_patch(data) {

packages/discord.js/src/structures/PermissionOverwrites.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class PermissionOverwrites extends Base {
2424
*/
2525
Object.defineProperty(this, 'channel', { value: channel });
2626

27-
if (data) this._patch(data);
27+
this._patch(data);
2828
}
2929

3030
_patch(data) {

packages/discord.js/src/structures/Role.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Role extends Base {
3838
*/
3939
this.unicodeEmoji = null;
4040

41-
if (data) this._patch(data);
41+
this._patch(data);
4242
}
4343

4444
_patch(data) {

packages/discord.js/src/structures/ThreadChannel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ThreadChannel extends BaseChannel {
5555
* @type {ThreadMemberManager}
5656
*/
5757
this.members = new ThreadMemberManager(this);
58-
if (data) this._patch(data);
58+
this._patch(data);
5959
}
6060

6161
_patch(data) {

packages/discord.js/src/structures/Webhook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Webhook {
2323
* @readonly
2424
*/
2525
Object.defineProperty(this, 'client', { value: client });
26-
if (data) this._patch(data);
26+
this._patch(data);
2727
}
2828

2929
_patch(data) {

packages/discord.js/typings/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3525,7 +3525,7 @@ export interface ThreadChannel<ThreadOnly extends boolean = boolean>
35253525
MessageChannelFields,
35263526
SendMethod<true> {}
35273527
export class ThreadChannel<ThreadOnly extends boolean = boolean> extends BaseChannel {
3528-
private constructor(guild: Guild, data?: RawThreadChannelData, client?: Client<true>);
3528+
private constructor(guild: Guild, data: RawThreadChannelData, client?: Client<true>);
35293529
public archived: boolean | null;
35303530
public get archivedAt(): Date | null;
35313531
public archiveTimestamp: number | null;
@@ -3821,7 +3821,7 @@ export class VoiceState extends Base {
38213821

38223822
export interface Webhook<Type extends WebhookType = WebhookType> extends WebhookFields {}
38233823
export class Webhook<Type extends WebhookType = WebhookType> {
3824-
private constructor(client: Client<true>, data?: unknown);
3824+
private constructor(client: Client<true>, data: unknown);
38253825
public avatar: string | null;
38263826
public avatarURL(options?: ImageURLOptions): string | null;
38273827
public channelId: Snowflake;

0 commit comments

Comments
 (0)