mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-16 09:39:09 +00:00
chore: update prettier tab width for consistency (#175)
This commit is contained in:
parent
a931f8c69c
commit
f24d2fcc99
247 changed files with 7224 additions and 7375 deletions
|
@ -2,25 +2,25 @@ import { sortBy } from '@roleypoly/misc-utils/sortBy';
|
|||
import { GuildSlug } from '@roleypoly/types';
|
||||
|
||||
type RecentAndSortedT = {
|
||||
recentGuildSlugs: GuildSlug[];
|
||||
sortedGuildSlugs: GuildSlug[];
|
||||
recentGuildSlugs: GuildSlug[];
|
||||
sortedGuildSlugs: GuildSlug[];
|
||||
};
|
||||
|
||||
export const getRecentAndSortedGuilds = (
|
||||
guilds: GuildSlug[],
|
||||
recentGuilds: string[]
|
||||
guilds: GuildSlug[],
|
||||
recentGuilds: string[]
|
||||
): RecentAndSortedT => {
|
||||
return {
|
||||
recentGuildSlugs: recentGuilds.reduce<GuildSlug[]>((acc, id) => {
|
||||
const guild = guilds.find((guild) => guild.id === id);
|
||||
if (guild) {
|
||||
acc.push(guild);
|
||||
}
|
||||
return {
|
||||
recentGuildSlugs: recentGuilds.reduce<GuildSlug[]>((acc, id) => {
|
||||
const guild = guilds.find((guild) => guild.id === id);
|
||||
if (guild) {
|
||||
acc.push(guild);
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, []),
|
||||
sortedGuildSlugs: sortBy(guilds, 'name', (a: string, b: string) =>
|
||||
a.toLowerCase() > b.toLowerCase() ? 1 : -1
|
||||
),
|
||||
};
|
||||
return acc;
|
||||
}, []),
|
||||
sortedGuildSlugs: sortBy(guilds, 'name', (a: string, b: string) =>
|
||||
a.toLowerCase() > b.toLowerCase() ? 1 : -1
|
||||
),
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue