UNPKG

@heap/react-native-heap

Version:

React Native event tracking with Heap.

23 lines (22 loc) 805 B
import * as _ from 'lodash'; import { REACT_NATIVE_ELEMENTS_CONFIG } from './libraryPropConfigs/rnElementsPropConfig'; import { NATIVE_BASE_CONFIG } from './libraryPropConfigs/nativeBasePropConfig'; const BASE_CONFIG = { '*': { include: ['testID'], exclude: [], }, Button: { include: ['title'], exclude: [], }, }; const propConfigMerger = (objValue, srcValue) => { if (_.isArray(objValue)) { return _.union(objValue, srcValue); } }; // :TODO: (jmtaber129): Consider allowing users to specify whether library-specific prop configs are // included in the default config. const builtinPropExtractorConfig = _.mergeWith({}, BASE_CONFIG, REACT_NATIVE_ELEMENTS_CONFIG, NATIVE_BASE_CONFIG, propConfigMerger); export { builtinPropExtractorConfig };