import { EventDefinition , EventsMap } from './types' ; function getEventsWithMatchingKey ( eventsMap , actionType ) { const objectKeys = Object . keys ( eventsMap ) ; const symbolKeys = Object . getOwnPropertySymbols ? Object . getOwnPropertySymbols ( eventsMap ) : [ ] ; return [ ... objectKeys , ... symbolKeys ] . filter ( key => key === '*' || key === actionType ) . map ( matchingKey => eventsMap [ matchingKey ] ) ; } export default getEventsWithMatchingKey ;