react-native-reanimated
Version:
More powerful alternative to Animated library for React Native.
24 lines (23 loc) • 608 B
JavaScript
;
import { isCSSStyleProp } from '../utils/guards';
function filterNonCSSStylePropsRecursive(props) {
if (Array.isArray(props)) {
return props.map(prop => filterNonCSSStylePropsRecursive(prop));
}
if (!props) {
return props;
}
if (typeof props === 'object') {
return Object.entries(props).reduce((acc, [key, value]) => {
if (!isCSSStyleProp(key)) {
acc[key] = value;
}
return acc;
}, {});
}
return props;
}
export function filterNonCSSStyleProps(props) {
return filterNonCSSStylePropsRecursive(props);
}
//# sourceMappingURL=utils.js.map