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 getChannelIdsFromMultipleTopics(topics: string[]): Promise {
const channelIdsPromises = topics.map(async topic => {
return Array.from((await this.channelIdByTopics.get(topic)) || []);
});
const channelIds = await Promise.all(channelIdsPromises);
// flatten the array of array and remove the duplicates
return Utils.unique(Utils.flatten2DimensionsArray(channelIds)).uniqueItems;
}
/**
.then(halves => Utils.flatten2DimensionsArray(halves))
.catch(err => {