PATH:
usr
/
local
/
lib
/
node_modules
/
bower
/
lib
/
node_modules
/
inquirer
/
node_modules
/
lodash
/
internal
var baseSetData = require('./baseSetData'), createBindWrapper = require('./createBindWrapper'), createHybridWrapper = require('./createHybridWrapper'), createPartialWrapper = require('./createPartialWrapper'), getData = require('./getData'), mergeData = require('./mergeData'), setData = require('./setData'); /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, BIND_KEY_FLAG = 2, PARTIAL_FLAG = 32, PARTIAL_RIGHT_FLAG = 64; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /* Native method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to reference. * @param {number} bitmask The bitmask of flags. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); partials = holders = undefined; } length -= (holders ? holders.length : 0); if (bitmask & PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : getData(func), newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; if (data) { mergeData(newData, data); bitmask = newData[1]; arity = newData[9]; } newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0); if (bitmask == BIND_FLAG) { var result = createBindWrapper(newData[0], newData[2]); } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { result = createPartialWrapper.apply(undefined, newData); } else { result = createHybridWrapper.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setter(result, newData); } module.exports = createWrapper;
[-] cacheIndexOf.js
[edit]
[-] charsLeftIndex.js
[edit]
[-] baseWrapperValue.js
[edit]
[-] shimKeys.js
[edit]
[-] createForOwn.js
[edit]
[-] deburrLetter.js
[edit]
[-] arrayEvery.js
[edit]
[-] baseFilter.js
[edit]
[-] getMatchData.js
[edit]
[-] isIterateeCall.js
[edit]
[-] arrayEach.js
[edit]
[-] createDefaults.js
[edit]
[-] mergeDefaults.js
[edit]
[-] baseForRight.js
[edit]
[-] baseValues.js
[edit]
[-] baseEachRight.js
[edit]
[-] baseFor.js
[edit]
[-] arraySum.js
[edit]
[-] createCompounder.js
[edit]
[-] baseForOwnRight.js
[edit]
[-] baseCompareAscending.js
[edit]
[-] baseWhile.js
[edit]
[-] baseDelay.js
[edit]
[-] metaMap.js
[edit]
[-] MapCache.js
[edit]
[-] arraySome.js
[edit]
[-] baseFindIndex.js
[edit]
[-] baseMatchesProperty.js
[edit]
[-] baseSortBy.js
[edit]
[-] baseRandom.js
[edit]
[-] baseDifference.js
[edit]
[-] compareAscending.js
[edit]
[-] LodashWrapper.js
[edit]
[-] invokePath.js
[edit]
[+]
..
[-] baseMap.js
[edit]
[-] isLaziable.js
[edit]
[-] unescapeHtmlChar.js
[edit]
[-] initCloneByTag.js
[edit]
[-] baseReduce.js
[edit]
[-] lazyReverse.js
[edit]
[-] baseUniq.js
[edit]
[-] baseGet.js
[edit]
[-] createReduce.js
[edit]
[-] cachePush.js
[edit]
[-] baseSum.js
[edit]
[-] escapeHtmlChar.js
[edit]
[-] mapHas.js
[edit]
[-] baseMatches.js
[edit]
[-] mapDelete.js
[edit]
[-] createCache.js
[edit]
[-] isArrayLike.js
[edit]
[-] toObject.js
[edit]
[-] basePropertyDeep.js
[edit]
[-] arrayFilter.js
[edit]
[-] assignWith.js
[edit]
[-] composeArgsRight.js
[edit]
[-] binaryIndex.js
[edit]
[-] mapSet.js
[edit]
[-] bindCallback.js
[edit]
[-] createExtremum.js
[edit]
[-] baseFunctions.js
[edit]
[-] baseToString.js
[edit]
[-] baseIsEqualDeep.js
[edit]
[-] createCtorWrapper.js
[edit]
[-] sortedUniq.js
[edit]
[-] arrayExtremum.js
[edit]
[-] baseExtremum.js
[edit]
[-] basePullAt.js
[edit]
[-] LazyWrapper.js
[edit]
[-] isStrictComparable.js
[edit]
[-] createBindWrapper.js
[edit]
[-] isObjectLike.js
[edit]
[-] createRound.js
[edit]
[-] getView.js
[edit]
[-] createAggregator.js
[edit]
[-] createFindKey.js
[edit]
[-] createBaseFor.js
[edit]
[-] getFuncName.js
[edit]
[-] trimmedRightIndex.js
[edit]
[-] isIndex.js
[edit]
[-] reEvaluate.js
[edit]
[-] reEscape.js
[edit]
[-] baseLodash.js
[edit]
[-] arrayConcat.js
[edit]
[-] escapeRegExpChar.js
[edit]
[-] baseIsFunction.js
[edit]
[-] baseForIn.js
[edit]
[-] toPath.js
[edit]
[-] arrayReduceRight.js
[edit]
[-] baseSortByOrder.js
[edit]
[-] baseSetData.js
[edit]
[-] arrayEachRight.js
[edit]
[-] baseFill.js
[edit]
[-] arrayMap.js
[edit]
[-] compareMultiple.js
[edit]
[-] mergeData.js
[edit]
[-] mapGet.js
[edit]
[-] createHybridWrapper.js
[edit]
[-] baseIndexOf.js
[edit]
[-] arrayPush.js
[edit]
[-] createCurry.js
[edit]
[-] realNames.js
[edit]
[-] arrayCopy.js
[edit]
[-] getNative.js
[edit]
[-] createPadding.js
[edit]
[-] charsRightIndex.js
[edit]
[-] baseCopy.js
[edit]
[-] baseCallback.js
[edit]
[-] pickByCallback.js
[edit]
[-] baseMerge.js
[edit]
[-] assignOwnDefaults.js
[edit]
[-] toIterable.js
[edit]
[-] baseCreate.js
[edit]
[-] initCloneArray.js
[edit]
[-] escapeStringChar.js
[edit]
[-] baseMergeDeep.js
[edit]
[-] createAssigner.js
[edit]
[-] createForEach.js
[edit]
[-] baseSome.js
[edit]
[-] trimmedLeftIndex.js
[edit]
[-] createFindIndex.js
[edit]
[-] arrayReduce.js
[edit]
[-] baseClone.js
[edit]
[-] isLength.js
[edit]
[-] indexOfNaN.js
[edit]
[-] createFlow.js
[edit]
[-] equalByTag.js
[edit]
[-] createWrapper.js
[edit]
[-] baseEach.js
[edit]
[-] composeArgs.js
[edit]
[-] equalObjects.js
[edit]
[-] baseFlatten.js
[edit]
[-] binaryIndexBy.js
[edit]
[-] assignDefaults.js
[edit]
[-] wrapperClone.js
[edit]
[-] createPadDir.js
[edit]
[-] isSpace.js
[edit]
[-] baseAssign.js
[edit]
[-] baseEvery.js
[edit]
[-] baseIsMatch.js
[edit]
[-] SetCache.js
[edit]
[-] replaceHolders.js
[edit]
[-] createObjectMapper.js
[edit]
[-] lazyClone.js
[edit]
[-] reInterpolate.js
[edit]
[-] bufferClone.js
[edit]
[-] createPartialWrapper.js
[edit]
[-] reorder.js
[edit]
[-] createBaseEach.js
[edit]
[-] baseAt.js
[edit]
[-] getLength.js
[edit]
[-] createPartial.js
[edit]
[-] createForIn.js
[edit]
[-] createFind.js
[edit]
[-] setData.js
[edit]
[-] getData.js
[edit]
[-] createSortedIndex.js
[edit]
[-] lazyValue.js
[edit]
[-] baseSlice.js
[edit]
[-] baseIsEqual.js
[edit]
[-] baseFind.js
[edit]
[-] equalArrays.js
[edit]
[-] baseForOwn.js
[edit]
[-] pickByArray.js
[edit]
[-] isKey.js
[edit]
[-] baseProperty.js
[edit]
[-] initCloneObject.js
[edit]