UNPKG

react-native-reanimated

Version:

More powerful alternative to Animated library for React Native.

19 lines (15 loc) 353 B
'use strict'; import type { DimensionValue } from 'react-native'; import { hasSuffix } from '../../utils'; export function parseDimensionValue(value: DimensionValue) { if (typeof value === 'object') { return; } if (typeof value === 'string') { return value; } if (!hasSuffix(value)) { return `${value}px`; } return value; }