MCPcopy
hub / github.com/pmndrs/react-spring / computeGoal

Function computeGoal

packages/core/src/helpers.ts:191–203  ·  view source on GitHub ↗
(value: T | FluidValue<T>)

Source from the content-addressed store, hash-verified

189
190// Compute the goal value, converting "red" to "rgba(255, 0, 0, 1)" in the process
191export function computeGoal<T>(value: T | FluidValue<T>): T {
192 const resolved = getFluidValue(value)
193 if (is.arr(resolved)) {
194 return resolved.map(computeGoal) as T
195 }
196 if (isAnimatedString(resolved)) {
197 return G.createStringInterpolator({
198 range: [0, 1],
199 output: [resolved, resolved],
200 })(1) as T
201 }
202 return resolved as T
203}
204
205export function hasProps(props: object) {
206 for (const _ in props) return true

Callers 3

setup.tsFile · 0.90
_mergeMethod · 0.90
checkFinishedFunction · 0.90

Calls 2

getFluidValueFunction · 0.90
isAnimatedStringFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…