Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async upsertEvent(roomIdOrEntry: string|EventEntry,
eventId?: string, channelId?: string, ts?: string, extras?: EventEntryExtra): Promise {
let storeEv: StoredEvent;
if (typeof(roomIdOrEntry) === "string") {
storeEv = new StoredEvent(
roomIdOrEntry,
eventId,
channelId,
ts,
extras,
);
} else {
const entry = roomIdOrEntry as EventEntry;
storeEv = new StoredEvent(
entry.roomId,
entry.eventId,
entry.slackChannelId,
entry.slackTs,
entry._extras,
);
}
public async upsertEvent(roomIdOrEntry: string|EventEntry,
eventId?: string, channelId?: string, ts?: string, extras?: EventEntryExtra): Promise {
let storeEv: StoredEvent;
if (typeof(roomIdOrEntry) === "string") {
storeEv = new StoredEvent(
roomIdOrEntry,
eventId,
channelId,
ts,
extras,
);
} else {
const entry = roomIdOrEntry as EventEntry;
storeEv = new StoredEvent(
entry.roomId,
entry.eventId,
entry.slackChannelId,
entry.slackTs,
entry._extras,
);
}
await this.eventStore.upsertEvent(storeEv);
}