mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
21 lines
608 B
JavaScript
21 lines
608 B
JavaScript
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;
|