import { TimelineDefinition } from 'motion/types/targets/dom/timeline/types' ; import { SequenceDefination } from '../hooks/useMotionTimeline/useMotionTimelineTypes' ; export const isOfType = < T > ( varToBeChecked , propertyToCheckFor ) : varToBeChecked is T => ( varToBeChecked as T ) [ propertyToCheckFor ] !== undefined ; export const convertRefsToElement = ( sequence ) : TimelineDefinition => { const newArray = [ ... sequence ] ; newArray . forEach ( ( array ) => { if ( isOfType ( array [ 0 ] , 'current' ) ) { array [ 0 ] = array [ 0 ] . current ; } } ) ; return newArray as TimelineDefinition ; } ;