refun
Version:
A collection of React Hook-enabled functions that compose harmoniously with each other. Similar to `recompose`, but:
15 lines (13 loc) • 434 B
JavaScript
import { UNDEFINED } from 'tsfn';
export var mapDefaultProps = function mapDefaultProps(defaultProps) {
return function (props) {
var mergedProps = Object.assign({}, props); // eslint-disable-next-line guard-for-in
for (var key in defaultProps) {
if (props[key] === UNDEFINED) {
mergedProps[key] = defaultProps[key];
}
}
return mergedProps;
};
};
//# sourceMappingURL=map-default-props.js.map