We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88131b9 commit 3c902a1Copy full SHA for 3c902a1
1 file changed
apps/storybook-react-native/.storybook/reanimated-mock.ts
@@ -94,8 +94,8 @@ export const interpolate = (
94
outputRange: number[],
95
): number => {
96
const i = inputRange.findIndex((v) => v >= value);
97
- if (i <= 0) return outputRange[0];
98
- if (i >= inputRange.length) return outputRange[outputRange.length - 1];
+ if (i === 0) return outputRange[0];
+ if (i === -1) return outputRange[outputRange.length - 1];
99
const t = (value - inputRange[i - 1]) / (inputRange[i] - inputRange[i - 1]);
100
return outputRange[i - 1] + t * (outputRange[i] - outputRange[i - 1]);
101
};
0 commit comments