mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
fix: remove extra loops (#848)
* fix: remove extra loops Co-authored-by: Skillz4Killz <Skillz4Killz@users.noreply.github.com>
This commit is contained in:
@@ -15,8 +15,9 @@ export async function getChannelWebhooks(channelId: string) {
|
||||
)) as DiscordWebhook[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((webhook) => snakeKeysToCamelCase<Webhook>(webhook))
|
||||
.map((webhook) => [webhook.id, webhook]),
|
||||
result.map((webhook) => [
|
||||
webhook.id,
|
||||
snakeKeysToCamelCase<Webhook>(webhook),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ export async function getChannelInvites(channelId: string) {
|
||||
)) as DiscordInvite[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((invite) => snakeKeysToCamelCase<Invite>(invite))
|
||||
.map((invite) => [invite.code, invite]),
|
||||
result.map((invite) => [invite.code, snakeKeysToCamelCase<Invite>(invite)]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ export async function getInvites(guildId: string) {
|
||||
)) as DiscordInvite[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((invite) => snakeKeysToCamelCase<Invite>(invite))
|
||||
.map((invite) => [invite.code, invite]),
|
||||
result.map((invite) => [invite.code, snakeKeysToCamelCase<Invite>(invite)]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ export async function getRoles(guildId: string) {
|
||||
)) as DiscordRole[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((role) => snakeKeysToCamelCase<Role>(role))
|
||||
.map((role) => [role.id, role]),
|
||||
result.map((role) => [role.id, snakeKeysToCamelCase<Role>(role)]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,9 @@ export async function getWebhooks(guildId: string) {
|
||||
)) as DiscordWebhook[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((webhook) => snakeKeysToCamelCase<Webhook>(webhook))
|
||||
.map((webhook) => [webhook.id, webhook]),
|
||||
result.map((webhook) => [
|
||||
webhook.id,
|
||||
snakeKeysToCamelCase<Webhook>(webhook),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user