UNPKG

refun

Version:

A collection of React Hook-enabled functions that compose harmoniously with each other. Similar to `recompose`, but:

21 lines (16 loc) 421 B
Object.defineProperty(exports, "__esModule", { value: true }); exports.mapDefaultProps = void 0; var _tsfn = require("tsfn"); const mapDefaultProps = defaultProps => props => { const mergedProps = { ...props }; for (const key in defaultProps) { if (props[key] === _tsfn.UNDEFINED) { mergedProps[key] = defaultProps[key]; } } return mergedProps; }; exports.mapDefaultProps = mapDefaultProps;