@signalwire/core
Version:
Shared code for the SignalWire JS SDK
18 lines (14 loc) • 358 B
text/typescript
import { InternalChatChannel } from '../..'
export const toInternalChatChannels = (
channels: string | string[] | undefined
): InternalChatChannel[] => {
const list = !channels || Array.isArray(channels) ? channels : [channels]
if (Array.isArray(list)) {
return list.map((name) => {
return {
name,
}
})
}
return []
}