mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Add types for Moderator commands (#5084)
* Add types for Moderator commands * Support User Priv Level & userLevel
This commit is contained in:
parent
9f515fc804
commit
c5bb38e907
10 changed files with 51 additions and 34 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Game, GametypeMap, Log, LogGroups, Message, Room } from 'types';
|
||||
import { Game, GametypeMap, LogItem, LogGroups, Message, Room } from 'types';
|
||||
|
||||
export default class NormalizeService {
|
||||
// Flatten room gameTypes into map object
|
||||
|
|
@ -26,7 +26,7 @@ export default class NormalizeService {
|
|||
}
|
||||
|
||||
// Flatten logs[] into object mapped by targetType (room, game, chat)
|
||||
static normalizeLogs(logs: Log[]): LogGroups {
|
||||
static normalizeLogs(logs: LogItem[]): LogGroups {
|
||||
return logs.reduce((obj, log) => {
|
||||
const { targetType } = log;
|
||||
obj[targetType] = obj[targetType] || [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue