import { SpringFn , SpringResult } from './Spring' ; import { SpringConfig } from './SpringConfig' ; export const EPSILON = 0.00001 ; export function invariant ( condition , message ) { if ( condition ) { return ; } throw new Error ( `Invariant failed: ${ message }` ) ; } export function normalizeT ( t , timeScale , timeStart ) { return Math . max ( 0 , t * timeScale - timeStart * timeScale ) ; } export function makeSpringFn ( config , main , position , velocity ) { return Object . assign ( main , { position , velocity , config : { ... config } , } ) ; }