UNPKG

lodash-es

Version:

The modern build of lodash exported as ES modules.

21 lines (18 loc) 608 B
import createWrapper from './createWrapper'; import replaceHolders from './replaceHolders'; import restParam from '../function/restParam'; /** * Creates a `_.partial` or `_.partialRight` function. * * @private * @param {boolean} flag The partial bit flag. * @returns {Function} Returns the new partial function. */ function createPartial(flag) { var partialFunc = restParam(function(func, partials) { var holders = replaceHolders(partials, partialFunc.placeholder); return createWrapper(func, flag, undefined, partials, holders); }); return partialFunc; } export default createPartial;