import isString from './isString' ; import { BaseEventHandlerOptions } from '../types/BaseEventHandlerOptions' ; function extractComponentIdFromArgs < T extends BaseEventHandlerOptions > ( componentIdOrOptions ? ) { if ( componentIdOrOptions === undefined ) { return ; } if ( isString ( componentIdOrOptions ) ) { return componentIdOrOptions ; } return ( componentIdOrOptions as T ) . componentId ; } export default extractComponentIdFromArgs ;