Build a keyframe value AST node from properties and optional ease.
( properties: Record<string, number | string>, ease?: string, )
| 1991 | |
| 1992 | /** Build a keyframe value AST node from properties and optional ease. */ |
| 1993 | function buildKeyframeValueNode( |
| 1994 | properties: Record<string, number | string>, |
| 1995 | ease?: string, |
| 1996 | ): AstNode { |
| 1997 | const effectiveEase = ease ?? (typeof properties.ease === "string" ? properties.ease : undefined); |
| 1998 | const entries = Object.entries(properties) |
| 1999 | .filter(([k]) => k !== "ease") |
| 2000 | .map(([k, v]) => `${safeKey(k)}: ${valueToCode(v)}`); |
| 2001 | if (effectiveEase) entries.push(`ease: ${JSON.stringify(effectiveEase)}`); |
| 2002 | return parseExpr(`{ ${entries.join(", ")} }`); |
| 2003 | } |
| 2004 | |
| 2005 | /** Parse + locate a target animation, returning null on failure. */ |
| 2006 | function locateAnimation( |
no test coverage detected