18 lines
331 B
TypeScript
18 lines
331 B
TypeScript
import { EventJsonDecoder } from './event-json';
|
|
|
|
export interface JoinEventJson {
|
|
owner?: string;
|
|
inviter?: string[];
|
|
}
|
|
|
|
export const decodeJoinEventJson: EventJsonDecoder<JoinEventJson> = (
|
|
message: string
|
|
) => {
|
|
const v = message.split(',');
|
|
|
|
return {
|
|
owner: v[0],
|
|
inviter: v.slice(1)
|
|
} as JoinEventJson;
|
|
};
|