Skip to content

Commit 84197a0

Browse files
committed
fix: Remove data conditional check (#11250)
* fix: remove conditional * types: sort types
1 parent 33bfded commit 84197a0

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
@@ -56,7 +56,7 @@ class GuildMember extends Base {
5656
*/
5757
Object.defineProperty(this, '_roles', { value: [], writable: true });
5858

59-
if (data) this._patch(data);
59+
this._patch(data);
6060
}
6161

6262
_patch(data) {

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

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

25-
if (data) this._patch(data);
25+
this._patch(data);
2626
}
2727

2828
_patch(data) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Role extends Base {
3434
*/
3535
this.unicodeEmoji = null;
3636

37-
if (data) this._patch(data);
37+
this._patch(data);
3838
}
3939

4040
_patch(data) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ThreadChannel extends BaseChannel {
4949
* @type {ThreadMemberManager}
5050
*/
5151
this.members = new ThreadMemberManager(this);
52-
if (data) this._patch(data);
52+
this._patch(data);
5353
}
5454

5555
_patch(data) {

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

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

2828
_patch(data) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3841,7 +3841,7 @@ export interface PrivateThreadChannel extends ThreadChannel<false> {
38413841
export interface ThreadChannel<ThreadOnly extends boolean = boolean>
38423842
extends Omit<TextBasedChannelFields<true>, 'fetchWebhooks' | 'createWebhook' | 'setNSFW'> {}
38433843
export class ThreadChannel<ThreadOnly extends boolean = boolean> extends BaseChannel {
3844-
private constructor(guild: Guild, data?: RawThreadChannelData, client?: Client<true>);
3844+
private constructor(guild: Guild, data: RawThreadChannelData, client?: Client<true>);
38453845
public archived: boolean | null;
38463846
public get archivedAt(): Date | null;
38473847
public archiveTimestamp: number | null;
@@ -4234,7 +4234,7 @@ export class VoiceState extends Base {
42344234
// tslint:disable-next-line no-empty-interface
42354235
export interface Webhook<Type extends WebhookType = WebhookType> extends WebhookFields {}
42364236
export class Webhook<Type extends WebhookType = WebhookType> {
4237-
private constructor(client: Client<true>, data?: RawWebhookData);
4237+
private constructor(client: Client<true>, data: RawWebhookData);
42384238
public avatar: string | null;
42394239
public avatarURL(options?: ImageURLOptions): string | null;
42404240
public channelId: Snowflake;

0 commit comments

Comments
 (0)