All files / src/utils resolve-value.ts

100% Statements 7/7
87.5% Branches 7/8
100% Functions 2/2
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12  44x   44x 409x     44x   161x    
import { CustomValueType, ValueTarget, SingleTarget } from "../types"
import { isKeyframesTarget } from "../animation/utils/is-keyframes-target"
 
export const isCustomValue = (v: any): v is CustomValueType => {
    return Boolean(v && typeof v === "object" && v.mix && v.toValue)
}
 
export const resolveFinalValueInKeyframes = (v: ValueTarget): SingleTarget => {
    // TODO maybe throw if v.length - 1 is placeholder token?
    return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v
}