import { IAudioNode } from '../interfaces'; import { TActiveInputConnection, TContext } from '../types'; export const deleteActiveInputConnection = ( activeInputConnections: Set>, source: IAudioNode, output: number ): null | TActiveInputConnection => { for (const activeInputConnection of activeInputConnections) { if (activeInputConnection[0] === source && activeInputConnection[1] === output) { activeInputConnections.delete(activeInputConnection); return activeInputConnection; } } return null; };