spee.ch/utils/isApprovedChannel.js

10 lines
321 B
JavaScript
Raw Permalink Normal View History

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;