Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createSortedStream(feeds) {
const streams = createStreams(feeds);
// eslint-disable-next-line no-unused-vars
const heap = new fastpriorityqueue_ts_1.FastPriorityQueue((t1, t2) => {
if (typeof t1 === 'undefined') {
if (typeof t2 === 'undefined') {
return false;
}
return true;
}
if (typeof t1 === 'undefined') {
return false;
}
return t1 < t2;
});
Object.keys(streams).forEach((type) => {
const stream = streams[type];
stream.pull((err, item) => {
if (!err && item) {
heap.add({