resolve-motion-value.mjs 516 B

12345678910111213141516
  1. import { isCustomValue } from '../../utils/resolve-value.mjs';
  2. import { isMotionValue } from './is-motion-value.mjs';
  3. /**
  4. * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
  5. *
  6. * TODO: Remove and move to library
  7. */
  8. function resolveMotionValue(value) {
  9. const unwrappedValue = isMotionValue(value) ? value.get() : value;
  10. return isCustomValue(unwrappedValue)
  11. ? unwrappedValue.toValue()
  12. : unwrappedValue;
  13. }
  14. export { resolveMotionValue };