import { BaseSetOptions , AnimationOptions , ITimelineModel } from '../core/types' ; import { plugins } from '../core/plugins' ; import { includes , list } from '../utils/lists' ; import { _ } from '../utils/constants' ; import { insert } from './insert' ; import { IReducer , IReducerContext } from '../core/types' ; export const set = ( model , options , ctx ) => { const pluginNames = Object . keys ( plugins ) ; const opts2 = list ( options ) . map ( opts => { const at = opts . at || model . cursor ; const opt2 = { } as AnimationOptions ; for ( var name in opts ) { if ( includes ( pluginNames , name ) ) { const props = opts [ name ] ; const props2 = { } as typeof props ; for ( var propName in props ) { var value = props [ propName ] ; props2 [ propName ] = [ _ , value ] ; } opt2 [ name ] = props2 ; } else { opt2 [ name ] = opts [ name ] ; } } opt2 . from = at - 0.000000001 ; opt2 . to = at ; return opt2 ; } ) ; insert ( model , opts2 , ctx ) ; } ;