fix: remove extra loops (#848)

* fix: remove extra loops

Co-authored-by: Skillz4Killz <Skillz4Killz@users.noreply.github.com>
This commit is contained in:
Skillz4Killz
2021-04-13 14:36:23 -04:00
committed by GitHub
parent da3f99cb2c
commit c85b76cd18
5 changed files with 11 additions and 15 deletions

View File

@@ -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),
]),
);
}

View File

@@ -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)]),
);
}

View File

@@ -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)]),
);
}

View File

@@ -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)]),
);
}

View File

@@ -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),
]),
);
}