Skip to content

🎥 Make videos programmatically with React

Update index.ts

Jonny Burgerc30b73a5b742
diff --git a/packages/core/src/spring/index.ts b/packages/core/src/spring/index.ts
index 4fffcc364b..e580a904fb 100644
--- a/packages/core/src/spring/index.ts
+++ b/packages/core/src/spring/index.ts
@@ -36,11 +36,11 @@ export function spring({
durationThreshold?: number;
}): number {
validateSpringDuration(durationInFrames);
- const durationRatio = durationInFrames
- ? durationInFrames /
- measureSpring({fps, config, from, to, threshold: durationThreshold})
- : 1;
-
+ const durationRatio =
+ durationInFrames === undefined
+ ? 1
+ : durationInFrames /
+ measureSpring({fps, config, from, to, threshold: durationThreshold});
const spr = springCalculation({
fps,
frame: frame / durationRatio,