1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 20:25:39 +02:00

Merge branch 'develop' into room

This commit is contained in:
syuilo
2026-04-16 12:47:24 +09:00
76 changed files with 4668 additions and 3589 deletions

View File

@@ -0,0 +1,25 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
type AvatarDecorationBase = { category?: string | null | undefined };
/**
* アバターデコレーションをカテゴリごとにグループ化します。
* @param decorations アバターデコレーションの配列
* @returns カテゴリごとにグループ化されたアバターデコレーションオブジェクト
*/
export function groupAvatarDecorations<T extends AvatarDecorationBase>(decorations: T[]) {
const grouped: Record<string, T[]> = {};
for (const decoration of decorations) {
const category = decoration.category ?? '';
if (!(category in grouped)) {
grouped[category] = [];
}
grouped[category].push(decoration);
}
return grouped;
}