10 lines
321 B
JavaScript
10 lines
321 B
JavaScript
|
function isApprovedChannel (channel, channels) {
|
||
|
const { name, shortId: short, longId: long } = channel;
|
||
|
return Boolean(
|
||
|
(long && channels.find(chan => chan.longId === long)) ||
|
||
|
(name && short && channels.find(chan => chan.name === name && chan.shortId === short))
|
||
|
);
|
||
|
}
|
||
|
|
||
|
module.exports = isApprovedChannel;
|