From b75a8d58e59b3c0b809e61928c70ec9a49d5112a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20F=C3=A9vrier?= Date: Wed, 31 May 2023 23:04:37 +0200 Subject: [PATCH] Fix: allow boolean in tweened instead of throwing an error See issue: https://github.com/sveltejs/svelte/issues/7543 --- src/runtime/motion/tweened.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/motion/tweened.ts b/src/runtime/motion/tweened.ts index f0ede9add731..36a71d08bef0 100644 --- a/src/runtime/motion/tweened.ts +++ b/src/runtime/motion/tweened.ts @@ -11,6 +11,8 @@ function get_interpolator(a, b) { if (type !== typeof b || Array.isArray(a) !== Array.isArray(b)) { throw new Error('Cannot interpolate values of different type'); } + + if (type === 'boolean') return () => b; if (Array.isArray(a)) { const arr = b.map((bi, i) => {