import { removePairs } from './removePairs' ; import type { AspDispAirgapParams } from '@opentrons/shared-data/protocol/types/schemaV3' ; import type { Command } from '@opentrons/shared-data/protocol/types/schemaV5Addendum' ; const _isEqualMix = ( a , b ) : boolean => { const compareParams = [ 'pipette' , 'volume' , 'labware' , 'well' , ] ; return compareParams . every ( param => a [ param ] === b [ param ] ) ; } ; export const _stripNoOpMixCommands = ( commands ) : Command [ ] => removePairs < Command > ( commands , ( a , b ) => a . command === 'aspirate' && b . command === 'dispense' && _isEqualMix ( a . params , b . params ) ) ; export const stripNoOpCommands = ( commands ) : Command [ ] => _stripNoOpMixCommands ( commands ) ;