MCPcopy Index your code
hub / github.com/pmndrs/react-spring / isAnimatedString

Function isAnimatedString

packages/shared/src/isAnimatedString.ts:6–15  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

4
5// Not all strings can be animated (eg: {display: "none"})
6export function isAnimatedString(value: unknown): value is string {
7 return (
8 is.str(value) &&
9 (value[0] == '#' ||
10 /\d/.test(value) ||
11 // Do not identify a CSS variable as an AnimatedString if its SSR
12 (!isSSR() && cssVariableRegex.test(value)) ||
13 value in (G.colors || {}))
14 )
15}

Callers 4

computeGoalFunction · 0.90
_mergeMethod · 0.90
makeAnimatedFunction · 0.90
getAnimatedTypeFunction · 0.90

Calls 1

isSSRFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…