diff --git a/README.md b/README.md
index b618f29cc..937b54f8d 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# lodash-amd v4.0.1
+# lodash-amd v4.1.0
The [lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
@@ -27,4 +27,4 @@ require({
});
```
-See the [package source](https://github.com/lodash/lodash/tree/4.0.1-amd) for more details.
+See the [package source](https://github.com/lodash/lodash/tree/4.1.0-amd) for more details.
diff --git a/internal/Hash.js b/_Hash.js
similarity index 87%
rename from internal/Hash.js
rename to _Hash.js
index f64429307..630664137 100644
--- a/internal/Hash.js
+++ b/_Hash.js
@@ -1,4 +1,4 @@
-define(['./nativeCreate'], function(nativeCreate) {
+define(['./_nativeCreate'], function(nativeCreate) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
diff --git a/internal/LazyWrapper.js b/_LazyWrapper.js
similarity index 89%
rename from internal/LazyWrapper.js
rename to _LazyWrapper.js
index acf1fbdbd..f2cd96e33 100644
--- a/internal/LazyWrapper.js
+++ b/_LazyWrapper.js
@@ -1,4 +1,4 @@
-define(['./baseCreate', './baseLodash'], function(baseCreate, baseLodash) {
+define(['./_baseCreate', './_baseLodash'], function(baseCreate, baseLodash) {
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
diff --git a/internal/LodashWrapper.js b/_LodashWrapper.js
similarity index 89%
rename from internal/LodashWrapper.js
rename to _LodashWrapper.js
index d72ec141c..a09a8aa4e 100644
--- a/internal/LodashWrapper.js
+++ b/_LodashWrapper.js
@@ -1,4 +1,4 @@
-define(['./baseCreate', './baseLodash'], function(baseCreate, baseLodash) {
+define(['./_baseCreate', './_baseLodash'], function(baseCreate, baseLodash) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/Map.js b/_Map.js
similarity index 65%
rename from internal/Map.js
rename to _Map.js
index b97b8769f..74050d4ff 100644
--- a/internal/Map.js
+++ b/_Map.js
@@ -1,4 +1,4 @@
-define(['./getNative', './root'], function(getNative, root) {
+define(['./_getNative', './_root'], function(getNative, root) {
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
diff --git a/internal/MapCache.js b/_MapCache.js
similarity index 82%
rename from internal/MapCache.js
rename to _MapCache.js
index 94780365a..4cbbec6ad 100644
--- a/internal/MapCache.js
+++ b/_MapCache.js
@@ -1,4 +1,4 @@
-define(['./mapClear', './mapDelete', './mapGet', './mapHas', './mapSet'], function(mapClear, mapDelete, mapGet, mapHas, mapSet) {
+define(['./_mapClear', './_mapDelete', './_mapGet', './_mapHas', './_mapSet'], function(mapClear, mapDelete, mapGet, mapHas, mapSet) {
/**
* Creates a map cache object to store key-value pairs.
diff --git a/internal/Reflect.js b/_Reflect.js
similarity index 70%
rename from internal/Reflect.js
rename to _Reflect.js
index 8984e2e00..b0fcc5d42 100644
--- a/internal/Reflect.js
+++ b/_Reflect.js
@@ -1,4 +1,4 @@
-define(['./root'], function(root) {
+define(['./_root'], function(root) {
/** Built-in value references. */
var Reflect = root.Reflect;
diff --git a/internal/Set.js b/_Set.js
similarity index 65%
rename from internal/Set.js
rename to _Set.js
index 72c6c2298..53823547e 100644
--- a/internal/Set.js
+++ b/_Set.js
@@ -1,4 +1,4 @@
-define(['./getNative', './root'], function(getNative, root) {
+define(['./_getNative', './_root'], function(getNative, root) {
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
diff --git a/internal/SetCache.js b/_SetCache.js
similarity index 86%
rename from internal/SetCache.js
rename to _SetCache.js
index cf3e4b3ae..d76d6a24c 100644
--- a/internal/SetCache.js
+++ b/_SetCache.js
@@ -1,4 +1,4 @@
-define(['./MapCache', './cachePush'], function(MapCache, cachePush) {
+define(['./_MapCache', './_cachePush'], function(MapCache, cachePush) {
/**
*
diff --git a/internal/Stack.js b/_Stack.js
similarity index 79%
rename from internal/Stack.js
rename to _Stack.js
index c223dfea6..ab8601af2 100644
--- a/internal/Stack.js
+++ b/_Stack.js
@@ -1,4 +1,4 @@
-define(['./stackClear', './stackDelete', './stackGet', './stackHas', './stackSet'], function(stackClear, stackDelete, stackGet, stackHas, stackSet) {
+define(['./_stackClear', './_stackDelete', './_stackGet', './_stackHas', './_stackSet'], function(stackClear, stackDelete, stackGet, stackHas, stackSet) {
/**
* Creates a stack cache object to store key-value pairs.
diff --git a/internal/Symbol.js b/_Symbol.js
similarity index 70%
rename from internal/Symbol.js
rename to _Symbol.js
index 5f1ba58e2..fca9d65e1 100644
--- a/internal/Symbol.js
+++ b/_Symbol.js
@@ -1,4 +1,4 @@
-define(['./root'], function(root) {
+define(['./_root'], function(root) {
/** Built-in value references. */
var Symbol = root.Symbol;
diff --git a/internal/Uint8Array.js b/_Uint8Array.js
similarity index 72%
rename from internal/Uint8Array.js
rename to _Uint8Array.js
index b462cd427..51bdedefe 100644
--- a/internal/Uint8Array.js
+++ b/_Uint8Array.js
@@ -1,4 +1,4 @@
-define(['./root'], function(root) {
+define(['./_root'], function(root) {
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
diff --git a/internal/WeakMap.js b/_WeakMap.js
similarity index 67%
rename from internal/WeakMap.js
rename to _WeakMap.js
index f9725d3ec..eb4d2c6f8 100644
--- a/internal/WeakMap.js
+++ b/_WeakMap.js
@@ -1,4 +1,4 @@
-define(['./getNative', './root'], function(getNative, root) {
+define(['./_getNative', './_root'], function(getNative, root) {
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
diff --git a/internal/addMapEntry.js b/_addMapEntry.js
similarity index 100%
rename from internal/addMapEntry.js
rename to _addMapEntry.js
diff --git a/internal/addSetEntry.js b/_addSetEntry.js
similarity index 100%
rename from internal/addSetEntry.js
rename to _addSetEntry.js
diff --git a/internal/apply.js b/_apply.js
similarity index 100%
rename from internal/apply.js
rename to _apply.js
diff --git a/_arrayAggregator.js b/_arrayAggregator.js
new file mode 100644
index 000000000..095bff362
--- /dev/null
+++ b/_arrayAggregator.js
@@ -0,0 +1,25 @@
+define([], function() {
+
+ /**
+ * A specialized version of `baseAggregator` for arrays.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform keys.
+ * @param {Object} accumulator The initial aggregated object.
+ * @returns {Function} Returns `accumulator`.
+ */
+ function arrayAggregator(array, setter, iteratee, accumulator) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ var value = array[index];
+ setter(accumulator, value, iteratee(value), array);
+ }
+ return accumulator;
+ }
+
+ return arrayAggregator;
+});
diff --git a/internal/arrayConcat.js b/_arrayConcat.js
similarity index 100%
rename from internal/arrayConcat.js
rename to _arrayConcat.js
diff --git a/internal/arrayEach.js b/_arrayEach.js
similarity index 100%
rename from internal/arrayEach.js
rename to _arrayEach.js
diff --git a/internal/arrayEachRight.js b/_arrayEachRight.js
similarity index 100%
rename from internal/arrayEachRight.js
rename to _arrayEachRight.js
diff --git a/internal/arrayEvery.js b/_arrayEvery.js
similarity index 100%
rename from internal/arrayEvery.js
rename to _arrayEvery.js
diff --git a/internal/arrayFilter.js b/_arrayFilter.js
similarity index 100%
rename from internal/arrayFilter.js
rename to _arrayFilter.js
diff --git a/internal/arrayIncludes.js b/_arrayIncludes.js
similarity index 89%
rename from internal/arrayIncludes.js
rename to _arrayIncludes.js
index 517ee1751..04ae91ad3 100644
--- a/internal/arrayIncludes.js
+++ b/_arrayIncludes.js
@@ -1,4 +1,4 @@
-define(['./baseIndexOf'], function(baseIndexOf) {
+define(['./_baseIndexOf'], function(baseIndexOf) {
/**
* A specialized version of `_.includes` for arrays without support for
diff --git a/internal/arrayIncludesWith.js b/_arrayIncludesWith.js
similarity index 100%
rename from internal/arrayIncludesWith.js
rename to _arrayIncludesWith.js
diff --git a/internal/arrayMap.js b/_arrayMap.js
similarity index 100%
rename from internal/arrayMap.js
rename to _arrayMap.js
diff --git a/internal/arrayPush.js b/_arrayPush.js
similarity index 100%
rename from internal/arrayPush.js
rename to _arrayPush.js
diff --git a/internal/arrayReduce.js b/_arrayReduce.js
similarity index 100%
rename from internal/arrayReduce.js
rename to _arrayReduce.js
diff --git a/internal/arrayReduceRight.js b/_arrayReduceRight.js
similarity index 100%
rename from internal/arrayReduceRight.js
rename to _arrayReduceRight.js
diff --git a/internal/arraySome.js b/_arraySome.js
similarity index 100%
rename from internal/arraySome.js
rename to _arraySome.js
diff --git a/internal/assignInDefaults.js b/_assignInDefaults.js
similarity index 96%
rename from internal/assignInDefaults.js
rename to _assignInDefaults.js
index dc3c34e66..3761bba22 100644
--- a/internal/assignInDefaults.js
+++ b/_assignInDefaults.js
@@ -1,4 +1,4 @@
-define(['../eq'], function(eq) {
+define(['./eq'], function(eq) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/assignMergeValue.js b/_assignMergeValue.js
similarity index 95%
rename from internal/assignMergeValue.js
rename to _assignMergeValue.js
index 43de9f857..f02682b23 100644
--- a/internal/assignMergeValue.js
+++ b/_assignMergeValue.js
@@ -1,4 +1,4 @@
-define(['../eq'], function(eq) {
+define(['./eq'], function(eq) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/assignValue.js b/_assignValue.js
similarity index 96%
rename from internal/assignValue.js
rename to _assignValue.js
index 710222dcb..96177477d 100644
--- a/internal/assignValue.js
+++ b/_assignValue.js
@@ -1,4 +1,4 @@
-define(['../eq'], function(eq) {
+define(['./eq'], function(eq) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/assocDelete.js b/_assocDelete.js
similarity index 93%
rename from internal/assocDelete.js
rename to _assocDelete.js
index 52676bd91..8a84bbd29 100644
--- a/internal/assocDelete.js
+++ b/_assocDelete.js
@@ -1,4 +1,4 @@
-define(['./assocIndexOf'], function(assocIndexOf) {
+define(['./_assocIndexOf'], function(assocIndexOf) {
/** Used for built-in method references. */
var arrayProto = Array.prototype;
diff --git a/internal/assocGet.js b/_assocGet.js
similarity index 89%
rename from internal/assocGet.js
rename to _assocGet.js
index 037e0e4d8..5a787e48e 100644
--- a/internal/assocGet.js
+++ b/_assocGet.js
@@ -1,4 +1,4 @@
-define(['./assocIndexOf'], function(assocIndexOf) {
+define(['./_assocIndexOf'], function(assocIndexOf) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/assocHas.js b/_assocHas.js
similarity index 87%
rename from internal/assocHas.js
rename to _assocHas.js
index 84613e6fc..4dab5ae31 100644
--- a/internal/assocHas.js
+++ b/_assocHas.js
@@ -1,4 +1,4 @@
-define(['./assocIndexOf'], function(assocIndexOf) {
+define(['./_assocIndexOf'], function(assocIndexOf) {
/**
* Checks if an associative array value for `key` exists.
diff --git a/internal/assocIndexOf.js b/_assocIndexOf.js
similarity index 93%
rename from internal/assocIndexOf.js
rename to _assocIndexOf.js
index fa6a4cd93..78a07596a 100644
--- a/internal/assocIndexOf.js
+++ b/_assocIndexOf.js
@@ -1,4 +1,4 @@
-define(['../eq'], function(eq) {
+define(['./eq'], function(eq) {
/**
* Gets the index at which the first occurrence of `key` is found in `array`
diff --git a/internal/assocSet.js b/_assocSet.js
similarity index 89%
rename from internal/assocSet.js
rename to _assocSet.js
index dbb95c0e7..13f14d433 100644
--- a/internal/assocSet.js
+++ b/_assocSet.js
@@ -1,4 +1,4 @@
-define(['./assocIndexOf'], function(assocIndexOf) {
+define(['./_assocIndexOf'], function(assocIndexOf) {
/**
* Sets the associative array `key` to `value`.
diff --git a/_baseAggregator.js b/_baseAggregator.js
new file mode 100644
index 000000000..1ef55e7a1
--- /dev/null
+++ b/_baseAggregator.js
@@ -0,0 +1,22 @@
+define(['./_baseEach'], function(baseEach) {
+
+ /**
+ * Aggregates elements of `collection` on `accumulator` with keys transformed
+ * by `iteratee` and values set by `setter`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform keys.
+ * @param {Object} accumulator The initial aggregated object.
+ * @returns {Function} Returns `accumulator`.
+ */
+ function baseAggregator(collection, setter, iteratee, accumulator) {
+ baseEach(collection, function(value, key, collection) {
+ setter(accumulator, value, iteratee(value), collection);
+ });
+ return accumulator;
+ }
+
+ return baseAggregator;
+});
diff --git a/internal/baseAssign.js b/_baseAssign.js
similarity index 86%
rename from internal/baseAssign.js
rename to _baseAssign.js
index 52375f445..083aa9f35 100644
--- a/internal/baseAssign.js
+++ b/_baseAssign.js
@@ -1,4 +1,4 @@
-define(['./copyObject', '../keys'], function(copyObject, keys) {
+define(['./_copyObject', './keys'], function(copyObject, keys) {
/**
* The base implementation of `_.assign` without support for multiple sources
diff --git a/internal/baseAt.js b/_baseAt.js
similarity index 95%
rename from internal/baseAt.js
rename to _baseAt.js
index 065e76028..8da9fdba5 100644
--- a/internal/baseAt.js
+++ b/_baseAt.js
@@ -1,4 +1,4 @@
-define(['../get'], function(get) {
+define(['./get'], function(get) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseClamp.js b/_baseClamp.js
similarity index 100%
rename from internal/baseClamp.js
rename to _baseClamp.js
diff --git a/internal/baseClone.js b/_baseClone.js
similarity index 90%
rename from internal/baseClone.js
rename to _baseClone.js
index 8616fcff0..78dcf7ad5 100644
--- a/internal/baseClone.js
+++ b/_baseClone.js
@@ -1,4 +1,4 @@
-define(['./Stack', './arrayEach', './assignValue', './baseAssign', './baseForOwn', './copyArray', './copySymbols', './getTag', './initCloneArray', './initCloneByTag', './initCloneObject', '../isArray', './isHostObject', '../isObject'], function(Stack, arrayEach, assignValue, baseAssign, baseForOwn, copyArray, copySymbols, getTag, initCloneArray, initCloneByTag, initCloneObject, isArray, isHostObject, isObject) {
+define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_baseForOwn', './_copyArray', './_copySymbols', './_getTag', './_initCloneArray', './_initCloneByTag', './_initCloneObject', './isArray', './_isHostObject', './isObject'], function(Stack, arrayEach, assignValue, baseAssign, baseForOwn, copyArray, copySymbols, getTag, initCloneArray, initCloneByTag, initCloneObject, isArray, isHostObject, isObject) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseConforms.js b/_baseConforms.js
similarity index 95%
rename from internal/baseConforms.js
rename to _baseConforms.js
index 64405f8b1..23759283f 100644
--- a/internal/baseConforms.js
+++ b/_baseConforms.js
@@ -1,4 +1,4 @@
-define(['../keys'], function(keys) {
+define(['./keys'], function(keys) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseCreate.js b/_baseCreate.js
similarity index 93%
rename from internal/baseCreate.js
rename to _baseCreate.js
index bf5cc336a..91e355e53 100644
--- a/internal/baseCreate.js
+++ b/_baseCreate.js
@@ -1,4 +1,4 @@
-define(['../isObject'], function(isObject) {
+define(['./isObject'], function(isObject) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseDelay.js b/_baseDelay.js
similarity index 100%
rename from internal/baseDelay.js
rename to _baseDelay.js
diff --git a/internal/baseDifference.js b/_baseDifference.js
similarity index 89%
rename from internal/baseDifference.js
rename to _baseDifference.js
index 8f52c8c69..51f5ca3a1 100644
--- a/internal/baseDifference.js
+++ b/_baseDifference.js
@@ -1,4 +1,4 @@
-define(['./SetCache', './arrayIncludes', './arrayIncludesWith', './arrayMap', './baseUnary', './cacheHas'], function(SetCache, arrayIncludes, arrayIncludesWith, arrayMap, baseUnary, cacheHas) {
+define(['./_SetCache', './_arrayIncludes', './_arrayIncludesWith', './_arrayMap', './_baseUnary', './_cacheHas'], function(SetCache, arrayIncludes, arrayIncludesWith, arrayMap, baseUnary, cacheHas) {
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
diff --git a/internal/baseEach.js b/_baseEach.js
similarity index 81%
rename from internal/baseEach.js
rename to _baseEach.js
index 8ba1cd29c..92a6d040d 100644
--- a/internal/baseEach.js
+++ b/_baseEach.js
@@ -1,4 +1,4 @@
-define(['./baseForOwn', './createBaseEach'], function(baseForOwn, createBaseEach) {
+define(['./_baseForOwn', './_createBaseEach'], function(baseForOwn, createBaseEach) {
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
diff --git a/internal/baseEachRight.js b/_baseEachRight.js
similarity index 80%
rename from internal/baseEachRight.js
rename to _baseEachRight.js
index e6071d9b7..877900fc4 100644
--- a/internal/baseEachRight.js
+++ b/_baseEachRight.js
@@ -1,4 +1,4 @@
-define(['./baseForOwnRight', './createBaseEach'], function(baseForOwnRight, createBaseEach) {
+define(['./_baseForOwnRight', './_createBaseEach'], function(baseForOwnRight, createBaseEach) {
/**
* The base implementation of `_.forEachRight` without support for iteratee shorthands.
diff --git a/internal/baseEvery.js b/_baseEvery.js
similarity index 93%
rename from internal/baseEvery.js
rename to _baseEvery.js
index 83774a59e..5a5411d18 100644
--- a/internal/baseEvery.js
+++ b/_baseEvery.js
@@ -1,4 +1,4 @@
-define(['./baseEach'], function(baseEach) {
+define(['./_baseEach'], function(baseEach) {
/**
* The base implementation of `_.every` without support for iteratee shorthands.
diff --git a/internal/baseExtremum.js b/_baseExtremum.js
similarity index 100%
rename from internal/baseExtremum.js
rename to _baseExtremum.js
diff --git a/internal/baseFill.js b/_baseFill.js
similarity index 92%
rename from internal/baseFill.js
rename to _baseFill.js
index 0fc585c5f..bdf238254 100644
--- a/internal/baseFill.js
+++ b/_baseFill.js
@@ -1,4 +1,4 @@
-define(['../toInteger', '../toLength'], function(toInteger, toLength) {
+define(['./toInteger', './toLength'], function(toInteger, toLength) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseFilter.js b/_baseFilter.js
similarity index 92%
rename from internal/baseFilter.js
rename to _baseFilter.js
index ea2616735..e97d0eb57 100644
--- a/internal/baseFilter.js
+++ b/_baseFilter.js
@@ -1,4 +1,4 @@
-define(['./baseEach'], function(baseEach) {
+define(['./_baseEach'], function(baseEach) {
/**
* The base implementation of `_.filter` without support for iteratee shorthands.
diff --git a/internal/baseFind.js b/_baseFind.js
similarity index 100%
rename from internal/baseFind.js
rename to _baseFind.js
diff --git a/internal/baseFindIndex.js b/_baseFindIndex.js
similarity index 100%
rename from internal/baseFindIndex.js
rename to _baseFindIndex.js
diff --git a/internal/baseFlatten.js b/_baseFlatten.js
similarity index 88%
rename from internal/baseFlatten.js
rename to _baseFlatten.js
index 8cf62d87f..79d0a9158 100644
--- a/internal/baseFlatten.js
+++ b/_baseFlatten.js
@@ -1,4 +1,4 @@
-define(['./arrayPush', '../isArguments', '../isArray', '../isArrayLikeObject'], function(arrayPush, isArguments, isArray, isArrayLikeObject) {
+define(['./_arrayPush', './isArguments', './isArray', './isArrayLikeObject'], function(arrayPush, isArguments, isArray, isArrayLikeObject) {
/**
* The base implementation of `_.flatten` with support for restricting flattening.
diff --git a/internal/baseFor.js b/_baseFor.js
similarity index 91%
rename from internal/baseFor.js
rename to _baseFor.js
index f0a768635..41b0d2579 100644
--- a/internal/baseFor.js
+++ b/_baseFor.js
@@ -1,4 +1,4 @@
-define(['./createBaseFor'], function(createBaseFor) {
+define(['./_createBaseFor'], function(createBaseFor) {
/**
* The base implementation of `baseForIn` and `baseForOwn` which iterates
diff --git a/internal/baseForIn.js b/_baseForIn.js
similarity index 87%
rename from internal/baseForIn.js
rename to _baseForIn.js
index cfa5112d9..6f2f3a7ae 100644
--- a/internal/baseForIn.js
+++ b/_baseForIn.js
@@ -1,4 +1,4 @@
-define(['./baseFor', '../keysIn'], function(baseFor, keysIn) {
+define(['./_baseFor', './keysIn'], function(baseFor, keysIn) {
/**
* The base implementation of `_.forIn` without support for iteratee shorthands.
diff --git a/internal/baseForOwn.js b/_baseForOwn.js
similarity index 87%
rename from internal/baseForOwn.js
rename to _baseForOwn.js
index 1bb3f4460..b54820e9d 100644
--- a/internal/baseForOwn.js
+++ b/_baseForOwn.js
@@ -1,4 +1,4 @@
-define(['./baseFor', '../keys'], function(baseFor, keys) {
+define(['./_baseFor', './keys'], function(baseFor, keys) {
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
diff --git a/internal/baseForOwnRight.js b/_baseForOwnRight.js
similarity index 87%
rename from internal/baseForOwnRight.js
rename to _baseForOwnRight.js
index 71e1a74db..0a56be5fc 100644
--- a/internal/baseForOwnRight.js
+++ b/_baseForOwnRight.js
@@ -1,4 +1,4 @@
-define(['./baseForRight', '../keys'], function(baseForRight, keys) {
+define(['./_baseForRight', './keys'], function(baseForRight, keys) {
/**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands.
diff --git a/internal/baseForRight.js b/_baseForRight.js
similarity index 89%
rename from internal/baseForRight.js
rename to _baseForRight.js
index 9f4d51bdd..6d6326eb6 100644
--- a/internal/baseForRight.js
+++ b/_baseForRight.js
@@ -1,4 +1,4 @@
-define(['./createBaseFor'], function(createBaseFor) {
+define(['./_createBaseFor'], function(createBaseFor) {
/**
* This function is like `baseFor` except that it iterates over properties
diff --git a/internal/baseFunctions.js b/_baseFunctions.js
similarity index 89%
rename from internal/baseFunctions.js
rename to _baseFunctions.js
index d19880232..5bf9e6e05 100644
--- a/internal/baseFunctions.js
+++ b/_baseFunctions.js
@@ -1,4 +1,4 @@
-define(['./arrayFilter', '../isFunction'], function(arrayFilter, isFunction) {
+define(['./_arrayFilter', './isFunction'], function(arrayFilter, isFunction) {
/**
* The base implementation of `_.functions` which creates an array of
diff --git a/internal/baseGet.js b/_baseGet.js
similarity index 91%
rename from internal/baseGet.js
rename to _baseGet.js
index 9a4528222..e0e224ad6 100644
--- a/internal/baseGet.js
+++ b/_baseGet.js
@@ -1,4 +1,4 @@
-define(['./baseToPath', './isKey'], function(baseToPath, isKey) {
+define(['./_baseToPath', './_isKey'], function(baseToPath, isKey) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseHas.js b/_baseHas.js
similarity index 100%
rename from internal/baseHas.js
rename to _baseHas.js
diff --git a/internal/baseHasIn.js b/_baseHasIn.js
similarity index 100%
rename from internal/baseHasIn.js
rename to _baseHasIn.js
diff --git a/internal/baseInRange.js b/_baseInRange.js
similarity index 100%
rename from internal/baseInRange.js
rename to _baseInRange.js
diff --git a/internal/baseIndexOf.js b/_baseIndexOf.js
similarity index 93%
rename from internal/baseIndexOf.js
rename to _baseIndexOf.js
index e28fbb3b6..3e96d0681 100644
--- a/internal/baseIndexOf.js
+++ b/_baseIndexOf.js
@@ -1,4 +1,4 @@
-define(['./indexOfNaN'], function(indexOfNaN) {
+define(['./_indexOfNaN'], function(indexOfNaN) {
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
diff --git a/internal/baseIntersection.js b/_baseIntersection.js
similarity index 90%
rename from internal/baseIntersection.js
rename to _baseIntersection.js
index 429f00ff8..fff12ae74 100644
--- a/internal/baseIntersection.js
+++ b/_baseIntersection.js
@@ -1,4 +1,4 @@
-define(['./SetCache', './arrayIncludes', './arrayIncludesWith', './arrayMap', './baseUnary', './cacheHas'], function(SetCache, arrayIncludes, arrayIncludesWith, arrayMap, baseUnary, cacheHas) {
+define(['./_SetCache', './_arrayIncludes', './_arrayIncludesWith', './_arrayMap', './_baseUnary', './_cacheHas'], function(SetCache, arrayIncludes, arrayIncludesWith, arrayMap, baseUnary, cacheHas) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/_baseInverter.js b/_baseInverter.js
new file mode 100644
index 000000000..fefce7eb0
--- /dev/null
+++ b/_baseInverter.js
@@ -0,0 +1,22 @@
+define(['./_baseForOwn'], function(baseForOwn) {
+
+ /**
+ * The base implementation of `_.invert` and `_.invertBy` which inverts
+ * `object` with values transformed by `iteratee` and set by `setter`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform values.
+ * @param {Object} accumulator The initial inverted object.
+ * @returns {Function} Returns `accumulator`.
+ */
+ function baseInverter(object, setter, iteratee, accumulator) {
+ baseForOwn(object, function(value, key, object) {
+ setter(accumulator, iteratee(value), key, object);
+ });
+ return accumulator;
+ }
+
+ return baseInverter;
+});
diff --git a/internal/baseInvoke.js b/_baseInvoke.js
similarity index 86%
rename from internal/baseInvoke.js
rename to _baseInvoke.js
index ec9f1c740..2b6cd34a4 100644
--- a/internal/baseInvoke.js
+++ b/_baseInvoke.js
@@ -1,4 +1,4 @@
-define(['./apply', './baseToPath', './isKey', '../last', './parent'], function(apply, baseToPath, isKey, last, parent) {
+define(['./_apply', './_baseToPath', './_isKey', './last', './_parent'], function(apply, baseToPath, isKey, last, parent) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseIsEqual.js b/_baseIsEqual.js
similarity index 89%
rename from internal/baseIsEqual.js
rename to _baseIsEqual.js
index 205df6dfd..6cdbf701c 100644
--- a/internal/baseIsEqual.js
+++ b/_baseIsEqual.js
@@ -1,4 +1,4 @@
-define(['./baseIsEqualDeep', '../isObject', '../isObjectLike'], function(baseIsEqualDeep, isObject, isObjectLike) {
+define(['./_baseIsEqualDeep', './isObject', './isObjectLike'], function(baseIsEqualDeep, isObject, isObjectLike) {
/**
* The base implementation of `_.isEqual` which supports partial comparisons
diff --git a/internal/baseIsEqualDeep.js b/_baseIsEqualDeep.js
similarity index 91%
rename from internal/baseIsEqualDeep.js
rename to _baseIsEqualDeep.js
index 0bb93a631..1387050f6 100644
--- a/internal/baseIsEqualDeep.js
+++ b/_baseIsEqualDeep.js
@@ -1,4 +1,4 @@
-define(['./Stack', './equalArrays', './equalByTag', './equalObjects', './getTag', '../isArray', './isHostObject', '../isTypedArray'], function(Stack, equalArrays, equalByTag, equalObjects, getTag, isArray, isHostObject, isTypedArray) {
+define(['./_Stack', './_equalArrays', './_equalByTag', './_equalObjects', './_getTag', './isArray', './_isHostObject', './isTypedArray'], function(Stack, equalArrays, equalByTag, equalObjects, getTag, isArray, isHostObject, isTypedArray) {
/** Used to compose bitmasks for comparison styles. */
var PARTIAL_COMPARE_FLAG = 2;
diff --git a/internal/baseIsMatch.js b/_baseIsMatch.js
similarity index 96%
rename from internal/baseIsMatch.js
rename to _baseIsMatch.js
index 038ac7284..5ac2a3414 100644
--- a/internal/baseIsMatch.js
+++ b/_baseIsMatch.js
@@ -1,4 +1,4 @@
-define(['./Stack', './baseIsEqual'], function(Stack, baseIsEqual) {
+define(['./_Stack', './_baseIsEqual'], function(Stack, baseIsEqual) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseIteratee.js b/_baseIteratee.js
similarity index 77%
rename from internal/baseIteratee.js
rename to _baseIteratee.js
index 3467c52a6..ed461246e 100644
--- a/internal/baseIteratee.js
+++ b/_baseIteratee.js
@@ -1,4 +1,4 @@
-define(['./baseMatches', './baseMatchesProperty', '../identity', '../isArray', '../property'], function(baseMatches, baseMatchesProperty, identity, isArray, property) {
+define(['./_baseMatches', './_baseMatchesProperty', './identity', './isArray', './property'], function(baseMatches, baseMatchesProperty, identity, isArray, property) {
/**
* The base implementation of `_.iteratee`.
diff --git a/internal/baseKeys.js b/_baseKeys.js
similarity index 100%
rename from internal/baseKeys.js
rename to _baseKeys.js
diff --git a/internal/baseKeysIn.js b/_baseKeysIn.js
similarity index 92%
rename from internal/baseKeysIn.js
rename to _baseKeysIn.js
index fd1b9d805..ed8a694a8 100644
--- a/internal/baseKeysIn.js
+++ b/_baseKeysIn.js
@@ -1,4 +1,4 @@
-define(['./Reflect', './iteratorToArray'], function(Reflect, iteratorToArray) {
+define(['./_Reflect', './_iteratorToArray'], function(Reflect, iteratorToArray) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseLodash.js b/_baseLodash.js
similarity index 100%
rename from internal/baseLodash.js
rename to _baseLodash.js
diff --git a/internal/baseMap.js b/_baseMap.js
similarity index 90%
rename from internal/baseMap.js
rename to _baseMap.js
index 8f16f80f9..407033b73 100644
--- a/internal/baseMap.js
+++ b/_baseMap.js
@@ -1,4 +1,4 @@
-define(['./baseEach', '../isArrayLike'], function(baseEach, isArrayLike) {
+define(['./_baseEach', './isArrayLike'], function(baseEach, isArrayLike) {
/**
* The base implementation of `_.map` without support for iteratee shorthands.
diff --git a/internal/baseMatches.js b/_baseMatches.js
similarity index 91%
rename from internal/baseMatches.js
rename to _baseMatches.js
index b7ff8e405..988df8436 100644
--- a/internal/baseMatches.js
+++ b/_baseMatches.js
@@ -1,4 +1,4 @@
-define(['./baseIsMatch', './getMatchData'], function(baseIsMatch, getMatchData) {
+define(['./_baseIsMatch', './_getMatchData'], function(baseIsMatch, getMatchData) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseMatchesProperty.js b/_baseMatchesProperty.js
similarity index 90%
rename from internal/baseMatchesProperty.js
rename to _baseMatchesProperty.js
index d7e84156f..d93c10adf 100644
--- a/internal/baseMatchesProperty.js
+++ b/_baseMatchesProperty.js
@@ -1,4 +1,4 @@
-define(['./baseIsEqual', '../get', '../hasIn'], function(baseIsEqual, get, hasIn) {
+define(['./_baseIsEqual', './get', './hasIn'], function(baseIsEqual, get, hasIn) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseMerge.js b/_baseMerge.js
similarity index 91%
rename from internal/baseMerge.js
rename to _baseMerge.js
index 0cefe3e85..084f7ce07 100644
--- a/internal/baseMerge.js
+++ b/_baseMerge.js
@@ -1,4 +1,4 @@
-define(['./Stack', './arrayEach', './assignMergeValue', './baseMergeDeep', '../isArray', '../isObject', '../isTypedArray', '../keysIn'], function(Stack, arrayEach, assignMergeValue, baseMergeDeep, isArray, isObject, isTypedArray, keysIn) {
+define(['./_Stack', './_arrayEach', './_assignMergeValue', './_baseMergeDeep', './isArray', './isObject', './isTypedArray', './keysIn'], function(Stack, arrayEach, assignMergeValue, baseMergeDeep, isArray, isObject, isTypedArray, keysIn) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseMergeDeep.js b/_baseMergeDeep.js
similarity index 83%
rename from internal/baseMergeDeep.js
rename to _baseMergeDeep.js
index 0b31bb258..ecdd48a39 100644
--- a/internal/baseMergeDeep.js
+++ b/_baseMergeDeep.js
@@ -1,4 +1,4 @@
-define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '../isArray', '../isArrayLikeObject', '../isFunction', '../isObject', '../isPlainObject', '../isTypedArray', '../toPlainObject'], function(assignMergeValue, baseClone, copyArray, isArguments, isArray, isArrayLikeObject, isFunction, isObject, isPlainObject, isTypedArray, toPlainObject) {
+define(['./_assignMergeValue', './_baseClone', './_copyArray', './isArguments', './isArray', './isArrayLikeObject', './isFunction', './isObject', './isPlainObject', './isTypedArray', './toPlainObject'], function(assignMergeValue, baseClone, copyArray, isArguments, isArray, isArrayLikeObject, isFunction, isObject, isPlainObject, isTypedArray, toPlainObject) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
@@ -20,7 +20,7 @@ define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '.
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = object[key],
srcValue = source[key],
- stacked = stack.get(srcValue) || stack.get(objValue);
+ stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object, key, stacked);
@@ -39,6 +39,7 @@ define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '.
newValue = copyArray(objValue);
}
else {
+ isCommon = false;
newValue = baseClone(srcValue);
}
}
@@ -47,6 +48,7 @@ define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '.
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
+ isCommon = false;
newValue = baseClone(srcValue);
}
else {
diff --git a/internal/baseOrderBy.js b/_baseOrderBy.js
similarity index 85%
rename from internal/baseOrderBy.js
rename to _baseOrderBy.js
index 37f5f097a..1d85a0fa4 100644
--- a/internal/baseOrderBy.js
+++ b/_baseOrderBy.js
@@ -1,4 +1,4 @@
-define(['./arrayMap', './baseIteratee', './baseMap', './baseSortBy', './compareMultiple'], function(arrayMap, baseIteratee, baseMap, baseSortBy, compareMultiple) {
+define(['./_arrayMap', './_baseIteratee', './_baseMap', './_baseSortBy', './_compareMultiple'], function(arrayMap, baseIteratee, baseMap, baseSortBy, compareMultiple) {
/**
* The base implementation of `_.orderBy` without param guards.
diff --git a/internal/basePick.js b/_basePick.js
similarity index 91%
rename from internal/basePick.js
rename to _basePick.js
index 1a5ccb691..6a2fa1e08 100644
--- a/internal/basePick.js
+++ b/_basePick.js
@@ -1,4 +1,4 @@
-define(['./arrayReduce'], function(arrayReduce) {
+define(['./_arrayReduce'], function(arrayReduce) {
/**
* The base implementation of `_.pick` without support for individual
diff --git a/internal/basePickBy.js b/_basePickBy.js
similarity index 91%
rename from internal/basePickBy.js
rename to _basePickBy.js
index 93fd3b28e..ad56917fd 100644
--- a/internal/basePickBy.js
+++ b/_basePickBy.js
@@ -1,4 +1,4 @@
-define(['./baseForIn'], function(baseForIn) {
+define(['./_baseForIn'], function(baseForIn) {
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
diff --git a/internal/baseProperty.js b/_baseProperty.js
similarity index 100%
rename from internal/baseProperty.js
rename to _baseProperty.js
diff --git a/internal/basePropertyDeep.js b/_basePropertyDeep.js
similarity index 89%
rename from internal/basePropertyDeep.js
rename to _basePropertyDeep.js
index d386e1a2d..37519bb7f 100644
--- a/internal/basePropertyDeep.js
+++ b/_basePropertyDeep.js
@@ -1,4 +1,4 @@
-define(['./baseGet'], function(baseGet) {
+define(['./_baseGet'], function(baseGet) {
/**
* A specialized version of `baseProperty` which supports deep paths.
diff --git a/internal/basePullAll.js b/_basePullAll.js
similarity index 85%
rename from internal/basePullAll.js
rename to _basePullAll.js
index 9a5b29636..f25db630a 100644
--- a/internal/basePullAll.js
+++ b/_basePullAll.js
@@ -1,4 +1,4 @@
-define(['./basePullAllBy'], function(basePullAllBy) {
+define(['./_basePullAllBy'], function(basePullAllBy) {
/**
* The base implementation of `_.pullAll`.
diff --git a/internal/basePullAllBy.js b/_basePullAllBy.js
similarity index 93%
rename from internal/basePullAllBy.js
rename to _basePullAllBy.js
index c0967b091..b1a3400d8 100644
--- a/internal/basePullAllBy.js
+++ b/_basePullAllBy.js
@@ -1,4 +1,4 @@
-define(['./arrayMap', './baseIndexOf'], function(arrayMap, baseIndexOf) {
+define(['./_arrayMap', './_baseIndexOf'], function(arrayMap, baseIndexOf) {
/** Used for built-in method references. */
var arrayProto = Array.prototype;
diff --git a/internal/basePullAt.js b/_basePullAt.js
similarity index 89%
rename from internal/basePullAt.js
rename to _basePullAt.js
index b143e22ec..c68033122 100644
--- a/internal/basePullAt.js
+++ b/_basePullAt.js
@@ -1,4 +1,4 @@
-define(['./baseToPath', './isIndex', './isKey', '../last', './parent'], function(baseToPath, isIndex, isKey, last, parent) {
+define(['./_baseToPath', './_isIndex', './_isKey', './last', './_parent'], function(baseToPath, isIndex, isKey, last, parent) {
/** Used for built-in method references. */
var arrayProto = Array.prototype;
diff --git a/internal/baseRandom.js b/_baseRandom.js
similarity index 100%
rename from internal/baseRandom.js
rename to _baseRandom.js
diff --git a/internal/baseRange.js b/_baseRange.js
similarity index 100%
rename from internal/baseRange.js
rename to _baseRange.js
diff --git a/internal/baseReduce.js b/_baseReduce.js
similarity index 100%
rename from internal/baseReduce.js
rename to _baseReduce.js
diff --git a/internal/baseSet.js b/_baseSet.js
similarity index 89%
rename from internal/baseSet.js
rename to _baseSet.js
index 247fa9904..241b10c52 100644
--- a/internal/baseSet.js
+++ b/_baseSet.js
@@ -1,4 +1,4 @@
-define(['./assignValue', './baseToPath', './isIndex', './isKey', '../isObject'], function(assignValue, baseToPath, isIndex, isKey, isObject) {
+define(['./_assignValue', './_baseToPath', './_isIndex', './_isKey', './isObject'], function(assignValue, baseToPath, isIndex, isKey, isObject) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/baseSetData.js b/_baseSetData.js
similarity index 86%
rename from internal/baseSetData.js
rename to _baseSetData.js
index 18bd4f90d..05cafb328 100644
--- a/internal/baseSetData.js
+++ b/_baseSetData.js
@@ -1,4 +1,4 @@
-define(['../identity', './metaMap'], function(identity, metaMap) {
+define(['./identity', './_metaMap'], function(identity, metaMap) {
/**
* The base implementation of `setData` without support for hot loop detection.
diff --git a/internal/baseSlice.js b/_baseSlice.js
similarity index 100%
rename from internal/baseSlice.js
rename to _baseSlice.js
diff --git a/internal/baseSome.js b/_baseSome.js
similarity index 93%
rename from internal/baseSome.js
rename to _baseSome.js
index b9a3b34a4..9e71766ca 100644
--- a/internal/baseSome.js
+++ b/_baseSome.js
@@ -1,4 +1,4 @@
-define(['./baseEach'], function(baseEach) {
+define(['./_baseEach'], function(baseEach) {
/**
* The base implementation of `_.some` without support for iteratee shorthands.
diff --git a/internal/baseSortBy.js b/_baseSortBy.js
similarity index 100%
rename from internal/baseSortBy.js
rename to _baseSortBy.js
diff --git a/internal/baseSortedIndex.js b/_baseSortedIndex.js
similarity index 95%
rename from internal/baseSortedIndex.js
rename to _baseSortedIndex.js
index f711235de..ecbba61d8 100644
--- a/internal/baseSortedIndex.js
+++ b/_baseSortedIndex.js
@@ -1,4 +1,4 @@
-define(['./baseSortedIndexBy', '../identity'], function(baseSortedIndexBy, identity) {
+define(['./_baseSortedIndexBy', './identity'], function(baseSortedIndexBy, identity) {
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295,
diff --git a/internal/baseSortedIndexBy.js b/_baseSortedIndexBy.js
similarity index 100%
rename from internal/baseSortedIndexBy.js
rename to _baseSortedIndexBy.js
diff --git a/internal/baseSortedUniq.js b/_baseSortedUniq.js
similarity index 82%
rename from internal/baseSortedUniq.js
rename to _baseSortedUniq.js
index c135c65d3..618622529 100644
--- a/internal/baseSortedUniq.js
+++ b/_baseSortedUniq.js
@@ -1,4 +1,4 @@
-define(['./baseSortedUniqBy'], function(baseSortedUniqBy) {
+define(['./_baseSortedUniqBy'], function(baseSortedUniqBy) {
/**
* The base implementation of `_.sortedUniq`.
diff --git a/internal/baseSortedUniqBy.js b/_baseSortedUniqBy.js
similarity index 96%
rename from internal/baseSortedUniqBy.js
rename to _baseSortedUniqBy.js
index e55c44726..ec218be22 100644
--- a/internal/baseSortedUniqBy.js
+++ b/_baseSortedUniqBy.js
@@ -1,4 +1,4 @@
-define(['../eq'], function(eq) {
+define(['./eq'], function(eq) {
/**
* The base implementation of `_.sortedUniqBy` without support for iteratee
diff --git a/internal/baseSum.js b/_baseSum.js
similarity index 95%
rename from internal/baseSum.js
rename to _baseSum.js
index 3448ed335..feb11a1f4 100644
--- a/internal/baseSum.js
+++ b/_baseSum.js
@@ -22,7 +22,7 @@ define([], function() {
result = result === undefined ? current : (result + current);
}
}
- return result;
+ return length ? result : 0;
}
return baseSum;
diff --git a/internal/baseTimes.js b/_baseTimes.js
similarity index 100%
rename from internal/baseTimes.js
rename to _baseTimes.js
diff --git a/internal/baseToPairs.js b/_baseToPairs.js
similarity index 92%
rename from internal/baseToPairs.js
rename to _baseToPairs.js
index 530ac7dd5..a554fdf7e 100644
--- a/internal/baseToPairs.js
+++ b/_baseToPairs.js
@@ -1,4 +1,4 @@
-define(['./arrayMap'], function(arrayMap) {
+define(['./_arrayMap'], function(arrayMap) {
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
diff --git a/internal/baseToPath.js b/_baseToPath.js
similarity index 85%
rename from internal/baseToPath.js
rename to _baseToPath.js
index 026cc65c3..66832e992 100644
--- a/internal/baseToPath.js
+++ b/_baseToPath.js
@@ -1,4 +1,4 @@
-define(['../isArray', './stringToPath'], function(isArray, stringToPath) {
+define(['./isArray', './_stringToPath'], function(isArray, stringToPath) {
/**
* The base implementation of `_.toPath` which only converts `value` to a
diff --git a/internal/baseUnary.js b/_baseUnary.js
similarity index 100%
rename from internal/baseUnary.js
rename to _baseUnary.js
diff --git a/internal/baseUniq.js b/_baseUniq.js
similarity index 89%
rename from internal/baseUniq.js
rename to _baseUniq.js
index c99b54385..426b414cc 100644
--- a/internal/baseUniq.js
+++ b/_baseUniq.js
@@ -1,4 +1,4 @@
-define(['./SetCache', './arrayIncludes', './arrayIncludesWith', './cacheHas', './createSet', './setToArray'], function(SetCache, arrayIncludes, arrayIncludesWith, cacheHas, createSet, setToArray) {
+define(['./_SetCache', './_arrayIncludes', './_arrayIncludesWith', './_cacheHas', './_createSet', './_setToArray'], function(SetCache, arrayIncludes, arrayIncludesWith, cacheHas, createSet, setToArray) {
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
diff --git a/internal/baseUnset.js b/_baseUnset.js
similarity index 81%
rename from internal/baseUnset.js
rename to _baseUnset.js
index ca15e145e..3e874bd17 100644
--- a/internal/baseUnset.js
+++ b/_baseUnset.js
@@ -1,4 +1,4 @@
-define(['./baseToPath', '../has', './isKey', '../last', './parent'], function(baseToPath, has, isKey, last, parent) {
+define(['./_baseToPath', './has', './_isKey', './last', './_parent'], function(baseToPath, has, isKey, last, parent) {
/**
* The base implementation of `_.unset`.
diff --git a/internal/baseValues.js b/_baseValues.js
similarity index 92%
rename from internal/baseValues.js
rename to _baseValues.js
index 85cd2a25a..bf752ce70 100644
--- a/internal/baseValues.js
+++ b/_baseValues.js
@@ -1,4 +1,4 @@
-define(['./arrayMap'], function(arrayMap) {
+define(['./_arrayMap'], function(arrayMap) {
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
diff --git a/internal/baseWhile.js b/_baseWhile.js
similarity index 95%
rename from internal/baseWhile.js
rename to _baseWhile.js
index d2800a97e..5e42a5cf1 100644
--- a/internal/baseWhile.js
+++ b/_baseWhile.js
@@ -1,4 +1,4 @@
-define(['./baseSlice'], function(baseSlice) {
+define(['./_baseSlice'], function(baseSlice) {
/**
* The base implementation of methods like `_.dropWhile` and `_.takeWhile`
diff --git a/internal/baseWrapperValue.js b/_baseWrapperValue.js
similarity index 87%
rename from internal/baseWrapperValue.js
rename to _baseWrapperValue.js
index af11a73d7..db53e77ab 100644
--- a/internal/baseWrapperValue.js
+++ b/_baseWrapperValue.js
@@ -1,4 +1,4 @@
-define(['./LazyWrapper', './arrayPush', './arrayReduce'], function(LazyWrapper, arrayPush, arrayReduce) {
+define(['./_LazyWrapper', './_arrayPush', './_arrayReduce'], function(LazyWrapper, arrayPush, arrayReduce) {
/**
* The base implementation of `wrapperValue` which returns the result of
diff --git a/internal/baseXor.js b/_baseXor.js
similarity index 89%
rename from internal/baseXor.js
rename to _baseXor.js
index ef948ad17..25b2e662f 100644
--- a/internal/baseXor.js
+++ b/_baseXor.js
@@ -1,4 +1,4 @@
-define(['./arrayPush', './baseDifference', './baseUniq'], function(arrayPush, baseDifference, baseUniq) {
+define(['./_arrayPush', './_baseDifference', './_baseUniq'], function(arrayPush, baseDifference, baseUniq) {
/**
* The base implementation of methods like `_.xor`, without support for
diff --git a/_baseZipObject.js b/_baseZipObject.js
new file mode 100644
index 000000000..8480283cc
--- /dev/null
+++ b/_baseZipObject.js
@@ -0,0 +1,28 @@
+define([], function() {
+
+ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
+ var undefined;
+
+ /**
+ * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
+ *
+ * @private
+ * @param {Array} props The property names.
+ * @param {Array} values The property values.
+ * @param {Function} assignFunc The function to assign values.
+ * @returns {Object} Returns the new object.
+ */
+ function baseZipObject(props, values, assignFunc) {
+ var index = -1,
+ length = props.length,
+ valsLength = values.length,
+ result = {};
+
+ while (++index < length) {
+ assignFunc(result, props[index], index < valsLength ? values[index] : undefined);
+ }
+ return result;
+ }
+
+ return baseZipObject;
+});
diff --git a/internal/cacheHas.js b/_cacheHas.js
similarity index 93%
rename from internal/cacheHas.js
rename to _cacheHas.js
index 6b0685499..b6afe305e 100644
--- a/internal/cacheHas.js
+++ b/_cacheHas.js
@@ -1,4 +1,4 @@
-define(['./isKeyable'], function(isKeyable) {
+define(['./_isKeyable'], function(isKeyable) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
diff --git a/internal/cachePush.js b/_cachePush.js
similarity index 92%
rename from internal/cachePush.js
rename to _cachePush.js
index c1fbdd4d7..d77b27648 100644
--- a/internal/cachePush.js
+++ b/_cachePush.js
@@ -1,4 +1,4 @@
-define(['./isKeyable'], function(isKeyable) {
+define(['./_isKeyable'], function(isKeyable) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
diff --git a/internal/charsEndIndex.js b/_charsEndIndex.js
similarity index 91%
rename from internal/charsEndIndex.js
rename to _charsEndIndex.js
index 52dbf7ff6..4f48146d5 100644
--- a/internal/charsEndIndex.js
+++ b/_charsEndIndex.js
@@ -1,4 +1,4 @@
-define(['./baseIndexOf'], function(baseIndexOf) {
+define(['./_baseIndexOf'], function(baseIndexOf) {
/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
diff --git a/internal/charsStartIndex.js b/_charsStartIndex.js
similarity index 92%
rename from internal/charsStartIndex.js
rename to _charsStartIndex.js
index e8aafb2ed..367d1ae8c 100644
--- a/internal/charsStartIndex.js
+++ b/_charsStartIndex.js
@@ -1,4 +1,4 @@
-define(['./baseIndexOf'], function(baseIndexOf) {
+define(['./_baseIndexOf'], function(baseIndexOf) {
/**
* Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
diff --git a/internal/checkGlobal.js b/_checkGlobal.js
similarity index 100%
rename from internal/checkGlobal.js
rename to _checkGlobal.js
diff --git a/internal/cloneBuffer.js b/_cloneBuffer.js
similarity index 89%
rename from internal/cloneBuffer.js
rename to _cloneBuffer.js
index 3775717d3..a9067fe2c 100644
--- a/internal/cloneBuffer.js
+++ b/_cloneBuffer.js
@@ -1,4 +1,4 @@
-define(['./Uint8Array'], function(Uint8Array) {
+define(['./_Uint8Array'], function(Uint8Array) {
/**
* Creates a clone of `buffer`.
diff --git a/internal/cloneMap.js b/_cloneMap.js
similarity index 73%
rename from internal/cloneMap.js
rename to _cloneMap.js
index 84e02b9d5..7c31b6f5d 100644
--- a/internal/cloneMap.js
+++ b/_cloneMap.js
@@ -1,4 +1,4 @@
-define(['./addMapEntry', './arrayReduce', './mapToArray'], function(addMapEntry, arrayReduce, mapToArray) {
+define(['./_addMapEntry', './_arrayReduce', './_mapToArray'], function(addMapEntry, arrayReduce, mapToArray) {
/**
* Creates a clone of `map`.
diff --git a/internal/cloneRegExp.js b/_cloneRegExp.js
similarity index 100%
rename from internal/cloneRegExp.js
rename to _cloneRegExp.js
diff --git a/internal/cloneSet.js b/_cloneSet.js
similarity index 73%
rename from internal/cloneSet.js
rename to _cloneSet.js
index e6bf19494..3ae4abee6 100644
--- a/internal/cloneSet.js
+++ b/_cloneSet.js
@@ -1,4 +1,4 @@
-define(['./addSetEntry', './arrayReduce', './setToArray'], function(addSetEntry, arrayReduce, setToArray) {
+define(['./_addSetEntry', './_arrayReduce', './_setToArray'], function(addSetEntry, arrayReduce, setToArray) {
/**
* Creates a clone of `set`.
diff --git a/internal/cloneSymbol.js b/_cloneSymbol.js
similarity index 93%
rename from internal/cloneSymbol.js
rename to _cloneSymbol.js
index f0e1fd66d..171cc49dd 100644
--- a/internal/cloneSymbol.js
+++ b/_cloneSymbol.js
@@ -1,4 +1,4 @@
-define(['./Symbol'], function(Symbol) {
+define(['./_Symbol'], function(Symbol) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/cloneTypedArray.js b/_cloneTypedArray.js
similarity index 90%
rename from internal/cloneTypedArray.js
rename to _cloneTypedArray.js
index 07a721336..f9d0613dd 100644
--- a/internal/cloneTypedArray.js
+++ b/_cloneTypedArray.js
@@ -1,4 +1,4 @@
-define(['./cloneBuffer'], function(cloneBuffer) {
+define(['./_cloneBuffer'], function(cloneBuffer) {
/**
* Creates a clone of `typedArray`.
diff --git a/internal/compareAscending.js b/_compareAscending.js
similarity index 100%
rename from internal/compareAscending.js
rename to _compareAscending.js
diff --git a/internal/compareMultiple.js b/_compareMultiple.js
similarity index 96%
rename from internal/compareMultiple.js
rename to _compareMultiple.js
index 7b5da5feb..30d838877 100644
--- a/internal/compareMultiple.js
+++ b/_compareMultiple.js
@@ -1,4 +1,4 @@
-define(['./compareAscending'], function(compareAscending) {
+define(['./_compareAscending'], function(compareAscending) {
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
diff --git a/internal/composeArgs.js b/_composeArgs.js
similarity index 100%
rename from internal/composeArgs.js
rename to _composeArgs.js
diff --git a/internal/composeArgsRight.js b/_composeArgsRight.js
similarity index 100%
rename from internal/composeArgsRight.js
rename to _composeArgsRight.js
diff --git a/internal/copyArray.js b/_copyArray.js
similarity index 100%
rename from internal/copyArray.js
rename to _copyArray.js
diff --git a/internal/copyObject.js b/_copyObject.js
similarity index 88%
rename from internal/copyObject.js
rename to _copyObject.js
index fbca36528..825043a3f 100644
--- a/internal/copyObject.js
+++ b/_copyObject.js
@@ -1,4 +1,4 @@
-define(['./copyObjectWith'], function(copyObjectWith) {
+define(['./_copyObjectWith'], function(copyObjectWith) {
/**
* Copies properties of `source` to `object`.
diff --git a/internal/copyObjectWith.js b/_copyObjectWith.js
similarity index 94%
rename from internal/copyObjectWith.js
rename to _copyObjectWith.js
index 2272e3dbb..c069fa444 100644
--- a/internal/copyObjectWith.js
+++ b/_copyObjectWith.js
@@ -1,4 +1,4 @@
-define(['./assignValue'], function(assignValue) {
+define(['./_assignValue'], function(assignValue) {
/**
* This function is like `copyObject` except that it accepts a function to
diff --git a/internal/copySymbols.js b/_copySymbols.js
similarity index 83%
rename from internal/copySymbols.js
rename to _copySymbols.js
index e6b15c780..1b87b0660 100644
--- a/internal/copySymbols.js
+++ b/_copySymbols.js
@@ -1,4 +1,4 @@
-define(['./copyObject', './getSymbols'], function(copyObject, getSymbols) {
+define(['./_copyObject', './_getSymbols'], function(copyObject, getSymbols) {
/**
* Copies own symbol properties of `source` to `object`.
diff --git a/_createAggregator.js b/_createAggregator.js
new file mode 100644
index 000000000..6623ddd19
--- /dev/null
+++ b/_createAggregator.js
@@ -0,0 +1,21 @@
+define(['./_arrayAggregator', './_baseAggregator', './_baseIteratee', './isArray'], function(arrayAggregator, baseAggregator, baseIteratee, isArray) {
+
+ /**
+ * Creates a function like `_.groupBy`.
+ *
+ * @private
+ * @param {Function} setter The function to set accumulator values.
+ * @param {Function} [initializer] The accumulator object initializer.
+ * @returns {Function} Returns the new aggregator function.
+ */
+ function createAggregator(setter, initializer) {
+ return function(collection, iteratee) {
+ var func = isArray(collection) ? arrayAggregator : baseAggregator,
+ accumulator = initializer ? initializer() : {};
+
+ return func(collection, setter, baseIteratee(iteratee), accumulator);
+ };
+ }
+
+ return createAggregator;
+});
diff --git a/internal/createAssigner.js b/_createAssigner.js
similarity index 94%
rename from internal/createAssigner.js
rename to _createAssigner.js
index 49521ee7e..3ab332753 100644
--- a/internal/createAssigner.js
+++ b/_createAssigner.js
@@ -1,4 +1,4 @@
-define(['./isIterateeCall', '../rest'], function(isIterateeCall, rest) {
+define(['./_isIterateeCall', './rest'], function(isIterateeCall, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/createBaseEach.js b/_createBaseEach.js
similarity index 94%
rename from internal/createBaseEach.js
rename to _createBaseEach.js
index a5a8bab0c..6bc2cde44 100644
--- a/internal/createBaseEach.js
+++ b/_createBaseEach.js
@@ -1,4 +1,4 @@
-define(['../isArrayLike'], function(isArrayLike) {
+define(['./isArrayLike'], function(isArrayLike) {
/**
* Creates a `baseEach` or `baseEachRight` function.
diff --git a/internal/createBaseFor.js b/_createBaseFor.js
similarity index 100%
rename from internal/createBaseFor.js
rename to _createBaseFor.js
diff --git a/internal/createBaseWrapper.js b/_createBaseWrapper.js
similarity index 91%
rename from internal/createBaseWrapper.js
rename to _createBaseWrapper.js
index 9f385248e..909ee5d27 100644
--- a/internal/createBaseWrapper.js
+++ b/_createBaseWrapper.js
@@ -1,4 +1,4 @@
-define(['./createCtorWrapper', './root'], function(createCtorWrapper, root) {
+define(['./_createCtorWrapper', './_root'], function(createCtorWrapper, root) {
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1;
diff --git a/internal/createCaseFirst.js b/_createCaseFirst.js
similarity index 95%
rename from internal/createCaseFirst.js
rename to _createCaseFirst.js
index c13c50d55..717069d7e 100644
--- a/internal/createCaseFirst.js
+++ b/_createCaseFirst.js
@@ -1,4 +1,4 @@
-define(['./stringToArray', '../toString'], function(stringToArray, toString) {
+define(['./_stringToArray', './toString'], function(stringToArray, toString) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/createCompounder.js b/_createCompounder.js
similarity index 80%
rename from internal/createCompounder.js
rename to _createCompounder.js
index b5c060b38..6a136194a 100644
--- a/internal/createCompounder.js
+++ b/_createCompounder.js
@@ -1,4 +1,4 @@
-define(['./arrayReduce', '../deburr', '../words'], function(arrayReduce, deburr, words) {
+define(['./_arrayReduce', './deburr', './words'], function(arrayReduce, deburr, words) {
/**
* Creates a function like `_.camelCase`.
diff --git a/internal/createCtorWrapper.js b/_createCtorWrapper.js
similarity index 95%
rename from internal/createCtorWrapper.js
rename to _createCtorWrapper.js
index 1e2dd98c6..2bbbe2a6f 100644
--- a/internal/createCtorWrapper.js
+++ b/_createCtorWrapper.js
@@ -1,4 +1,4 @@
-define(['./baseCreate', '../isObject'], function(baseCreate, isObject) {
+define(['./_baseCreate', './isObject'], function(baseCreate, isObject) {
/**
* Creates a function that produces an instance of `Ctor` regardless of
diff --git a/internal/createCurryWrapper.js b/_createCurryWrapper.js
similarity index 84%
rename from internal/createCurryWrapper.js
rename to _createCurryWrapper.js
index c3422a046..c1f9c1ab8 100644
--- a/internal/createCurryWrapper.js
+++ b/_createCurryWrapper.js
@@ -1,4 +1,4 @@
-define(['./apply', './createCtorWrapper', './createHybridWrapper', './createRecurryWrapper', './replaceHolders', './root'], function(apply, createCtorWrapper, createHybridWrapper, createRecurryWrapper, replaceHolders, root) {
+define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_createRecurryWrapper', './_replaceHolders', './_root'], function(apply, createCtorWrapper, createHybridWrapper, createRecurryWrapper, replaceHolders, root) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/createFlow.js b/_createFlow.js
similarity index 91%
rename from internal/createFlow.js
rename to _createFlow.js
index 931bd24dc..997d91c7e 100644
--- a/internal/createFlow.js
+++ b/_createFlow.js
@@ -1,4 +1,4 @@
-define(['./LodashWrapper', './baseFlatten', './getData', './getFuncName', '../isArray', './isLaziable', '../rest'], function(LodashWrapper, baseFlatten, getData, getFuncName, isArray, isLaziable, rest) {
+define(['./_LodashWrapper', './_baseFlatten', './_getData', './_getFuncName', './isArray', './_isLaziable', './rest'], function(LodashWrapper, baseFlatten, getData, getFuncName, isArray, isLaziable, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/createHybridWrapper.js b/_createHybridWrapper.js
similarity index 91%
rename from internal/createHybridWrapper.js
rename to _createHybridWrapper.js
index 92ae56c6f..6947080f7 100644
--- a/internal/createHybridWrapper.js
+++ b/_createHybridWrapper.js
@@ -1,4 +1,4 @@
-define(['./composeArgs', './composeArgsRight', './createCtorWrapper', './createRecurryWrapper', './reorder', './replaceHolders', './root'], function(composeArgs, composeArgsRight, createCtorWrapper, createRecurryWrapper, reorder, replaceHolders, root) {
+define(['./_composeArgs', './_composeArgsRight', './_createCtorWrapper', './_createRecurryWrapper', './_reorder', './_replaceHolders', './_root'], function(composeArgs, composeArgsRight, createCtorWrapper, createRecurryWrapper, reorder, replaceHolders, root) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/_createInverter.js b/_createInverter.js
new file mode 100644
index 000000000..dc16e953a
--- /dev/null
+++ b/_createInverter.js
@@ -0,0 +1,18 @@
+define(['./_baseInverter'], function(baseInverter) {
+
+ /**
+ * Creates a function like `_.invertBy`.
+ *
+ * @private
+ * @param {Function} setter The function to set accumulator values.
+ * @param {Function} toIteratee The function to resolve iteratees.
+ * @returns {Function} Returns the new inverter function.
+ */
+ function createInverter(setter, toIteratee) {
+ return function(object, iteratee) {
+ return baseInverter(object, setter, toIteratee(iteratee), {});
+ };
+ }
+
+ return createInverter;
+});
diff --git a/internal/createOver.js b/_createOver.js
similarity index 79%
rename from internal/createOver.js
rename to _createOver.js
index 659333ea3..42e739769 100644
--- a/internal/createOver.js
+++ b/_createOver.js
@@ -1,4 +1,4 @@
-define(['./apply', './arrayMap', './baseFlatten', './baseIteratee', '../rest'], function(apply, arrayMap, baseFlatten, baseIteratee, rest) {
+define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './rest'], function(apply, arrayMap, baseFlatten, baseIteratee, rest) {
/**
* Creates a function like `_.over`.
diff --git a/internal/createPadding.js b/_createPadding.js
similarity index 96%
rename from internal/createPadding.js
rename to _createPadding.js
index d9b7a0f92..a8b21ef70 100644
--- a/internal/createPadding.js
+++ b/_createPadding.js
@@ -1,4 +1,4 @@
-define(['../repeat', './stringSize', './stringToArray', '../toInteger'], function(repeat, stringSize, stringToArray, toInteger) {
+define(['./repeat', './_stringSize', './_stringToArray', './toInteger'], function(repeat, stringSize, stringToArray, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/createPartialWrapper.js b/_createPartialWrapper.js
similarity index 93%
rename from internal/createPartialWrapper.js
rename to _createPartialWrapper.js
index b8a5942f9..dcccbe2f5 100644
--- a/internal/createPartialWrapper.js
+++ b/_createPartialWrapper.js
@@ -1,4 +1,4 @@
-define(['./apply', './createCtorWrapper', './root'], function(apply, createCtorWrapper, root) {
+define(['./_apply', './_createCtorWrapper', './_root'], function(apply, createCtorWrapper, root) {
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1;
diff --git a/internal/createRange.js b/_createRange.js
similarity index 89%
rename from internal/createRange.js
rename to _createRange.js
index 08f92f244..2a3143571 100644
--- a/internal/createRange.js
+++ b/_createRange.js
@@ -1,4 +1,4 @@
-define(['./baseRange', './isIterateeCall', '../toNumber'], function(baseRange, isIterateeCall, toNumber) {
+define(['./_baseRange', './_isIterateeCall', './toNumber'], function(baseRange, isIterateeCall, toNumber) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/createRecurryWrapper.js b/_createRecurryWrapper.js
similarity index 95%
rename from internal/createRecurryWrapper.js
rename to _createRecurryWrapper.js
index 26e51f37f..5c37effb1 100644
--- a/internal/createRecurryWrapper.js
+++ b/_createRecurryWrapper.js
@@ -1,4 +1,4 @@
-define(['./copyArray', './isLaziable', './setData'], function(copyArray, isLaziable, setData) {
+define(['./_copyArray', './_isLaziable', './_setData'], function(copyArray, isLaziable, setData) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/createRound.js b/_createRound.js
similarity index 89%
rename from internal/createRound.js
rename to _createRound.js
index a6902dd2a..2e55ede15 100644
--- a/internal/createRound.js
+++ b/_createRound.js
@@ -1,4 +1,4 @@
-define(['../toInteger', '../toNumber', '../toString'], function(toInteger, toNumber, toString) {
+define(['./toInteger', './toNumber', './toString'], function(toInteger, toNumber, toString) {
/**
* Creates a function like `_.round`.
diff --git a/internal/createSet.js b/_createSet.js
similarity index 85%
rename from internal/createSet.js
rename to _createSet.js
index 3c0249535..d0e2b2188 100644
--- a/internal/createSet.js
+++ b/_createSet.js
@@ -1,4 +1,4 @@
-define(['./Set', '../noop'], function(Set, noop) {
+define(['./_Set', './noop'], function(Set, noop) {
/**
* Creates a set of `values`.
diff --git a/internal/createWrapper.js b/_createWrapper.js
similarity index 91%
rename from internal/createWrapper.js
rename to _createWrapper.js
index 98045550e..09299bf91 100644
--- a/internal/createWrapper.js
+++ b/_createWrapper.js
@@ -1,4 +1,4 @@
-define(['./baseSetData', './createBaseWrapper', './createCurryWrapper', './createHybridWrapper', './createPartialWrapper', './getData', './mergeData', './setData', '../toInteger'], function(baseSetData, createBaseWrapper, createCurryWrapper, createHybridWrapper, createPartialWrapper, getData, mergeData, setData, toInteger) {
+define(['./_baseSetData', './_createBaseWrapper', './_createCurryWrapper', './_createHybridWrapper', './_createPartialWrapper', './_getData', './_mergeData', './_setData', './toInteger'], function(baseSetData, createBaseWrapper, createCurryWrapper, createHybridWrapper, createPartialWrapper, getData, mergeData, setData, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/deburrLetter.js b/_deburrLetter.js
similarity index 100%
rename from internal/deburrLetter.js
rename to _deburrLetter.js
diff --git a/internal/equalArrays.js b/_equalArrays.js
similarity index 98%
rename from internal/equalArrays.js
rename to _equalArrays.js
index 47b3c47a0..ca26961f0 100644
--- a/internal/equalArrays.js
+++ b/_equalArrays.js
@@ -1,4 +1,4 @@
-define(['./arraySome'], function(arraySome) {
+define(['./_arraySome'], function(arraySome) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/equalByTag.js b/_equalByTag.js
similarity index 96%
rename from internal/equalByTag.js
rename to _equalByTag.js
index b0c74ab4c..688901f03 100644
--- a/internal/equalByTag.js
+++ b/_equalByTag.js
@@ -1,4 +1,4 @@
-define(['./Symbol', './Uint8Array', './mapToArray', './setToArray'], function(Symbol, Uint8Array, mapToArray, setToArray) {
+define(['./_Symbol', './_Uint8Array', './_mapToArray', './_setToArray'], function(Symbol, Uint8Array, mapToArray, setToArray) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/equalObjects.js b/_equalObjects.js
similarity index 97%
rename from internal/equalObjects.js
rename to _equalObjects.js
index f21af5ff4..b5d72dcf0 100644
--- a/internal/equalObjects.js
+++ b/_equalObjects.js
@@ -1,4 +1,4 @@
-define(['./baseHas', '../keys'], function(baseHas, keys) {
+define(['./_baseHas', './keys'], function(baseHas, keys) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/escapeHtmlChar.js b/_escapeHtmlChar.js
similarity index 100%
rename from internal/escapeHtmlChar.js
rename to _escapeHtmlChar.js
diff --git a/internal/escapeStringChar.js b/_escapeStringChar.js
similarity index 100%
rename from internal/escapeStringChar.js
rename to _escapeStringChar.js
diff --git a/internal/getData.js b/_getData.js
similarity index 82%
rename from internal/getData.js
rename to _getData.js
index 7fb6f9043..13a5c9a12 100644
--- a/internal/getData.js
+++ b/_getData.js
@@ -1,4 +1,4 @@
-define(['./metaMap', '../noop'], function(metaMap, noop) {
+define(['./_metaMap', './noop'], function(metaMap, noop) {
/**
* Gets metadata for `func`.
diff --git a/internal/getFuncName.js b/_getFuncName.js
similarity index 94%
rename from internal/getFuncName.js
rename to _getFuncName.js
index 891ea727e..f54c559c0 100644
--- a/internal/getFuncName.js
+++ b/_getFuncName.js
@@ -1,4 +1,4 @@
-define(['./realNames'], function(realNames) {
+define(['./_realNames'], function(realNames) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
diff --git a/internal/getLength.js b/_getLength.js
similarity index 88%
rename from internal/getLength.js
rename to _getLength.js
index e7dfddff5..86ad66a1e 100644
--- a/internal/getLength.js
+++ b/_getLength.js
@@ -1,4 +1,4 @@
-define(['./baseProperty'], function(baseProperty) {
+define(['./_baseProperty'], function(baseProperty) {
/**
* Gets the "length" property value of `object`.
diff --git a/internal/getMatchData.js b/_getMatchData.js
similarity index 88%
rename from internal/getMatchData.js
rename to _getMatchData.js
index db8f88b6c..47560763c 100644
--- a/internal/getMatchData.js
+++ b/_getMatchData.js
@@ -1,4 +1,4 @@
-define(['./isStrictComparable', '../toPairs'], function(isStrictComparable, toPairs) {
+define(['./_isStrictComparable', './toPairs'], function(isStrictComparable, toPairs) {
/**
* Gets the property names, values, and compare flags of `object`.
diff --git a/internal/getNative.js b/_getNative.js
similarity index 92%
rename from internal/getNative.js
rename to _getNative.js
index 8c33541a8..976fe837b 100644
--- a/internal/getNative.js
+++ b/_getNative.js
@@ -1,4 +1,4 @@
-define(['../isNative'], function(isNative) {
+define(['./isNative'], function(isNative) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/getSymbols.js b/_getSymbols.js
similarity index 100%
rename from internal/getSymbols.js
rename to _getSymbols.js
diff --git a/internal/getTag.js b/_getTag.js
similarity index 96%
rename from internal/getTag.js
rename to _getTag.js
index 3536eaf49..7317171b5 100644
--- a/internal/getTag.js
+++ b/_getTag.js
@@ -1,4 +1,4 @@
-define(['./Map', './Set'], function(Map, Set) {
+define(['./_Map', './_Set'], function(Map, Set) {
/** `Object#toString` result references. */
var mapTag = '[object Map]',
diff --git a/internal/getView.js b/_getView.js
similarity index 100%
rename from internal/getView.js
rename to _getView.js
diff --git a/internal/hasPath.js b/_hasPath.js
similarity index 61%
rename from internal/hasPath.js
rename to _hasPath.js
index dfc6098e8..96e2647e4 100644
--- a/internal/hasPath.js
+++ b/_hasPath.js
@@ -1,4 +1,7 @@
-define(['./baseToPath', '../isArguments', '../isArray', './isIndex', './isKey', '../isLength', '../isString', '../last', './parent'], function(baseToPath, isArguments, isArray, isIndex, isKey, isLength, isString, last, parent) {
+define(['./_baseToPath', './isArguments', './isArray', './_isIndex', './_isKey', './isLength', './isString', './last', './_parent'], function(baseToPath, isArguments, isArray, isIndex, isKey, isLength, isString, last, parent) {
+
+ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
+ var undefined;
/**
* Checks if `path` exists on `object`.
@@ -22,8 +25,11 @@ define(['./baseToPath', '../isArguments', '../isArray', './isIndex', './isKey',
result = hasFunc(object, path);
}
}
- return result || (isLength(object && object.length) && isIndex(path, object.length) &&
- (isArray(object) || isString(object) || isArguments(object)));
+ var length = object ? object.length : undefined;
+ return result || (
+ !!length && isLength(length) && isIndex(path, length) &&
+ (isArray(object) || isString(object) || isArguments(object))
+ );
}
return hasPath;
diff --git a/internal/hashDelete.js b/_hashDelete.js
similarity index 89%
rename from internal/hashDelete.js
rename to _hashDelete.js
index b36cfafb8..df8fef00b 100644
--- a/internal/hashDelete.js
+++ b/_hashDelete.js
@@ -1,4 +1,4 @@
-define(['./hashHas'], function(hashHas) {
+define(['./_hashHas'], function(hashHas) {
/**
* Removes `key` and its value from the hash.
diff --git a/internal/hashGet.js b/_hashGet.js
similarity index 94%
rename from internal/hashGet.js
rename to _hashGet.js
index 06058ee91..7407ee3fa 100644
--- a/internal/hashGet.js
+++ b/_hashGet.js
@@ -1,4 +1,4 @@
-define(['./nativeCreate'], function(nativeCreate) {
+define(['./_nativeCreate'], function(nativeCreate) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/hashHas.js b/_hashHas.js
similarity index 92%
rename from internal/hashHas.js
rename to _hashHas.js
index 4495fec1b..9cc45708e 100644
--- a/internal/hashHas.js
+++ b/_hashHas.js
@@ -1,4 +1,4 @@
-define(['./nativeCreate'], function(nativeCreate) {
+define(['./_nativeCreate'], function(nativeCreate) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/hashSet.js b/_hashSet.js
similarity index 91%
rename from internal/hashSet.js
rename to _hashSet.js
index 3e847cb47..b729fcfd8 100644
--- a/internal/hashSet.js
+++ b/_hashSet.js
@@ -1,4 +1,4 @@
-define(['./nativeCreate'], function(nativeCreate) {
+define(['./_nativeCreate'], function(nativeCreate) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/indexKeys.js b/_indexKeys.js
similarity index 60%
rename from internal/indexKeys.js
rename to _indexKeys.js
index 0e0271e7d..06ad5b4c9 100644
--- a/internal/indexKeys.js
+++ b/_indexKeys.js
@@ -1,4 +1,4 @@
-define(['./baseTimes', '../isArguments', '../isArray', '../isLength', '../isString'], function(baseTimes, isArguments, isArray, isLength, isString) {
+define(['./_baseTimes', './isArguments', './isArray', './isLength', './isString'], function(baseTimes, isArguments, isArray, isLength, isString) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
@@ -13,9 +13,11 @@ define(['./baseTimes', '../isArguments', '../isArray', '../isLength', '../isStri
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
- return (isLength(length) && (isArray(object) || isString(object) || isArguments(object)))
- ? baseTimes(length, String)
- : null;
+ if (isLength(length) &&
+ (isArray(object) || isString(object) || isArguments(object))) {
+ return baseTimes(length, String);
+ }
+ return null;
}
return indexKeys;
diff --git a/internal/indexOfNaN.js b/_indexOfNaN.js
similarity index 100%
rename from internal/indexOfNaN.js
rename to _indexOfNaN.js
diff --git a/internal/initCloneArray.js b/_initCloneArray.js
similarity index 100%
rename from internal/initCloneArray.js
rename to _initCloneArray.js
diff --git a/internal/initCloneByTag.js b/_initCloneByTag.js
similarity index 90%
rename from internal/initCloneByTag.js
rename to _initCloneByTag.js
index 7f5b4ad73..d9f8d4994 100644
--- a/internal/initCloneByTag.js
+++ b/_initCloneByTag.js
@@ -1,4 +1,4 @@
-define(['./cloneBuffer', './cloneMap', './cloneRegExp', './cloneSet', './cloneSymbol', './cloneTypedArray'], function(cloneBuffer, cloneMap, cloneRegExp, cloneSet, cloneSymbol, cloneTypedArray) {
+define(['./_cloneBuffer', './_cloneMap', './_cloneRegExp', './_cloneSet', './_cloneSymbol', './_cloneTypedArray'], function(cloneBuffer, cloneMap, cloneRegExp, cloneSet, cloneSymbol, cloneTypedArray) {
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
diff --git a/internal/initCloneObject.js b/_initCloneObject.js
similarity index 73%
rename from internal/initCloneObject.js
rename to _initCloneObject.js
index 439e99998..cf4085533 100644
--- a/internal/initCloneObject.js
+++ b/_initCloneObject.js
@@ -1,4 +1,4 @@
-define(['./baseCreate', '../isFunction'], function(baseCreate, isFunction) {
+define(['./_baseCreate', './isFunction', './_isPrototype'], function(baseCreate, isFunction, isPrototype) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
@@ -11,6 +11,9 @@ define(['./baseCreate', '../isFunction'], function(baseCreate, isFunction) {
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
+ if (isPrototype(object)) {
+ return {};
+ }
var Ctor = object.constructor;
return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
}
diff --git a/internal/isHostObject.js b/_isHostObject.js
similarity index 100%
rename from internal/isHostObject.js
rename to _isHostObject.js
diff --git a/internal/isIndex.js b/_isIndex.js
similarity index 100%
rename from internal/isIndex.js
rename to _isIndex.js
diff --git a/internal/isIterateeCall.js b/_isIterateeCall.js
similarity index 87%
rename from internal/isIterateeCall.js
rename to _isIterateeCall.js
index 5f04470b2..fa2c0b7b7 100644
--- a/internal/isIterateeCall.js
+++ b/_isIterateeCall.js
@@ -1,4 +1,4 @@
-define(['../eq', '../isArrayLike', './isIndex', '../isObject'], function(eq, isArrayLike, isIndex, isObject) {
+define(['./eq', './isArrayLike', './_isIndex', './isObject'], function(eq, isArrayLike, isIndex, isObject) {
/**
* Checks if the provided arguments are from an iteratee call.
diff --git a/internal/isKey.js b/_isKey.js
similarity index 94%
rename from internal/isKey.js
rename to _isKey.js
index a1ff7407a..4536fb50c 100644
--- a/internal/isKey.js
+++ b/_isKey.js
@@ -1,4 +1,4 @@
-define(['../isArray'], function(isArray) {
+define(['./isArray'], function(isArray) {
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
diff --git a/internal/isKeyable.js b/_isKeyable.js
similarity index 100%
rename from internal/isKeyable.js
rename to _isKeyable.js
diff --git a/internal/isLaziable.js b/_isLaziable.js
similarity index 81%
rename from internal/isLaziable.js
rename to _isLaziable.js
index 72ab23b00..6ed983cee 100644
--- a/internal/isLaziable.js
+++ b/_isLaziable.js
@@ -1,4 +1,4 @@
-define(['./LazyWrapper', './getData', './getFuncName', '../wrapperLodash'], function(LazyWrapper, getData, getFuncName, lodash) {
+define(['./_LazyWrapper', './_getData', './_getFuncName', './wrapperLodash'], function(LazyWrapper, getData, getFuncName, lodash) {
/**
* Checks if `func` has a lazy counterpart.
diff --git a/internal/isPrototype.js b/_isPrototype.js
similarity index 100%
rename from internal/isPrototype.js
rename to _isPrototype.js
diff --git a/internal/isStrictComparable.js b/_isStrictComparable.js
similarity index 89%
rename from internal/isStrictComparable.js
rename to _isStrictComparable.js
index 58444325d..175f43861 100644
--- a/internal/isStrictComparable.js
+++ b/_isStrictComparable.js
@@ -1,4 +1,4 @@
-define(['../isObject'], function(isObject) {
+define(['./isObject'], function(isObject) {
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
diff --git a/internal/iteratorToArray.js b/_iteratorToArray.js
similarity index 100%
rename from internal/iteratorToArray.js
rename to _iteratorToArray.js
diff --git a/internal/lazyClone.js b/_lazyClone.js
similarity index 88%
rename from internal/lazyClone.js
rename to _lazyClone.js
index 216799545..d163bb44e 100644
--- a/internal/lazyClone.js
+++ b/_lazyClone.js
@@ -1,4 +1,4 @@
-define(['./LazyWrapper', './copyArray'], function(LazyWrapper, copyArray) {
+define(['./_LazyWrapper', './_copyArray'], function(LazyWrapper, copyArray) {
/**
* Creates a clone of the lazy wrapper object.
diff --git a/internal/lazyReverse.js b/_lazyReverse.js
similarity index 90%
rename from internal/lazyReverse.js
rename to _lazyReverse.js
index ba135ebf4..4b2b5ba1a 100644
--- a/internal/lazyReverse.js
+++ b/_lazyReverse.js
@@ -1,4 +1,4 @@
-define(['./LazyWrapper'], function(LazyWrapper) {
+define(['./_LazyWrapper'], function(LazyWrapper) {
/**
* Reverses the direction of lazy iteration.
diff --git a/internal/lazyValue.js b/_lazyValue.js
similarity index 94%
rename from internal/lazyValue.js
rename to _lazyValue.js
index 14637269c..7e62ff3d3 100644
--- a/internal/lazyValue.js
+++ b/_lazyValue.js
@@ -1,4 +1,4 @@
-define(['./baseWrapperValue', './getView', '../isArray'], function(baseWrapperValue, getView, isArray) {
+define(['./_baseWrapperValue', './_getView', './isArray'], function(baseWrapperValue, getView, isArray) {
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
diff --git a/internal/mapClear.js b/_mapClear.js
similarity index 83%
rename from internal/mapClear.js
rename to _mapClear.js
index bb7b60336..5a6a6d00f 100644
--- a/internal/mapClear.js
+++ b/_mapClear.js
@@ -1,4 +1,4 @@
-define(['./Hash', './Map'], function(Hash, Map) {
+define(['./_Hash', './_Map'], function(Hash, Map) {
/**
* Removes all key-value entries from the map.
diff --git a/internal/mapDelete.js b/_mapDelete.js
similarity index 81%
rename from internal/mapDelete.js
rename to _mapDelete.js
index fc0a57a5f..efb6daee3 100644
--- a/internal/mapDelete.js
+++ b/_mapDelete.js
@@ -1,4 +1,4 @@
-define(['./Map', './assocDelete', './hashDelete', './isKeyable'], function(Map, assocDelete, hashDelete, isKeyable) {
+define(['./_Map', './_assocDelete', './_hashDelete', './_isKeyable'], function(Map, assocDelete, hashDelete, isKeyable) {
/**
* Removes `key` and its value from the map.
diff --git a/internal/mapGet.js b/_mapGet.js
similarity index 80%
rename from internal/mapGet.js
rename to _mapGet.js
index 155efbba0..ed659aac4 100644
--- a/internal/mapGet.js
+++ b/_mapGet.js
@@ -1,4 +1,4 @@
-define(['./Map', './assocGet', './hashGet', './isKeyable'], function(Map, assocGet, hashGet, isKeyable) {
+define(['./_Map', './_assocGet', './_hashGet', './_isKeyable'], function(Map, assocGet, hashGet, isKeyable) {
/**
* Gets the map value for `key`.
diff --git a/internal/mapHas.js b/_mapHas.js
similarity index 82%
rename from internal/mapHas.js
rename to _mapHas.js
index f8bd0244c..f3c373efd 100644
--- a/internal/mapHas.js
+++ b/_mapHas.js
@@ -1,4 +1,4 @@
-define(['./Map', './assocHas', './hashHas', './isKeyable'], function(Map, assocHas, hashHas, isKeyable) {
+define(['./_Map', './_assocHas', './_hashHas', './_isKeyable'], function(Map, assocHas, hashHas, isKeyable) {
/**
* Checks if a map value for `key` exists.
diff --git a/internal/mapSet.js b/_mapSet.js
similarity index 83%
rename from internal/mapSet.js
rename to _mapSet.js
index 26615a46e..d4451186a 100644
--- a/internal/mapSet.js
+++ b/_mapSet.js
@@ -1,4 +1,4 @@
-define(['./Map', './assocSet', './hashSet', './isKeyable'], function(Map, assocSet, hashSet, isKeyable) {
+define(['./_Map', './_assocSet', './_hashSet', './_isKeyable'], function(Map, assocSet, hashSet, isKeyable) {
/**
* Sets the map `key` to `value`.
diff --git a/internal/mapToArray.js b/_mapToArray.js
similarity index 100%
rename from internal/mapToArray.js
rename to _mapToArray.js
diff --git a/internal/mergeData.js b/_mergeData.js
similarity index 95%
rename from internal/mergeData.js
rename to _mergeData.js
index a746b2a83..269d2fb23 100644
--- a/internal/mergeData.js
+++ b/_mergeData.js
@@ -1,4 +1,4 @@
-define(['./composeArgs', './composeArgsRight', './copyArray', './replaceHolders'], function(composeArgs, composeArgsRight, copyArray, replaceHolders) {
+define(['./_composeArgs', './_composeArgsRight', './_copyArray', './_replaceHolders'], function(composeArgs, composeArgsRight, copyArray, replaceHolders) {
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1,
diff --git a/internal/mergeDefaults.js b/_mergeDefaults.js
similarity index 93%
rename from internal/mergeDefaults.js
rename to _mergeDefaults.js
index 0519f03f4..a814a4c06 100644
--- a/internal/mergeDefaults.js
+++ b/_mergeDefaults.js
@@ -1,4 +1,4 @@
-define(['./baseMerge', '../isObject'], function(baseMerge, isObject) {
+define(['./_baseMerge', './isObject'], function(baseMerge, isObject) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/metaMap.js b/_metaMap.js
similarity index 71%
rename from internal/metaMap.js
rename to _metaMap.js
index 248947119..bec8467bc 100644
--- a/internal/metaMap.js
+++ b/_metaMap.js
@@ -1,4 +1,4 @@
-define(['./WeakMap'], function(WeakMap) {
+define(['./_WeakMap'], function(WeakMap) {
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
diff --git a/internal/nativeCreate.js b/_nativeCreate.js
similarity index 75%
rename from internal/nativeCreate.js
rename to _nativeCreate.js
index d2a0f8d9b..65f074e4c 100644
--- a/internal/nativeCreate.js
+++ b/_nativeCreate.js
@@ -1,4 +1,4 @@
-define(['./getNative'], function(getNative) {
+define(['./_getNative'], function(getNative) {
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
diff --git a/internal/parent.js b/_parent.js
similarity index 85%
rename from internal/parent.js
rename to _parent.js
index 742c5c801..83cea9dfc 100644
--- a/internal/parent.js
+++ b/_parent.js
@@ -1,4 +1,4 @@
-define(['./baseSlice', '../get'], function(baseSlice, get) {
+define(['./_baseSlice', './get'], function(baseSlice, get) {
/**
* Gets the parent value at `path` of `object`.
diff --git a/internal/reEscape.js b/_reEscape.js
similarity index 100%
rename from internal/reEscape.js
rename to _reEscape.js
diff --git a/internal/reEvaluate.js b/_reEvaluate.js
similarity index 100%
rename from internal/reEvaluate.js
rename to _reEvaluate.js
diff --git a/internal/reInterpolate.js b/_reInterpolate.js
similarity index 100%
rename from internal/reInterpolate.js
rename to _reInterpolate.js
diff --git a/internal/realNames.js b/_realNames.js
similarity index 100%
rename from internal/realNames.js
rename to _realNames.js
diff --git a/internal/reorder.js b/_reorder.js
similarity index 93%
rename from internal/reorder.js
rename to _reorder.js
index befc69ed3..d17ff4358 100644
--- a/internal/reorder.js
+++ b/_reorder.js
@@ -1,4 +1,4 @@
-define(['./copyArray', './isIndex'], function(copyArray, isIndex) {
+define(['./_copyArray', './_isIndex'], function(copyArray, isIndex) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/internal/replaceHolders.js b/_replaceHolders.js
similarity index 100%
rename from internal/replaceHolders.js
rename to _replaceHolders.js
diff --git a/internal/root.js b/_root.js
similarity index 96%
rename from internal/root.js
rename to _root.js
index 90fca241e..193f85a65 100644
--- a/internal/root.js
+++ b/_root.js
@@ -1,4 +1,4 @@
-define(['./checkGlobal'], function(checkGlobal) {
+define(['./_checkGlobal'], function(checkGlobal) {
/** Used to determine if values are of the language type `Object`. */
var objectTypes = {
diff --git a/internal/setData.js b/_setData.js
similarity index 94%
rename from internal/setData.js
rename to _setData.js
index 28ef3e55a..c17fefe10 100644
--- a/internal/setData.js
+++ b/_setData.js
@@ -1,4 +1,4 @@
-define(['./baseSetData', '../now'], function(baseSetData, now) {
+define(['./_baseSetData', './now'], function(baseSetData, now) {
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 150,
diff --git a/internal/setToArray.js b/_setToArray.js
similarity index 100%
rename from internal/setToArray.js
rename to _setToArray.js
diff --git a/internal/stackClear.js b/_stackClear.js
similarity index 100%
rename from internal/stackClear.js
rename to _stackClear.js
diff --git a/internal/stackDelete.js b/_stackDelete.js
similarity index 89%
rename from internal/stackDelete.js
rename to _stackDelete.js
index 96a206f88..9b2c0b8f2 100644
--- a/internal/stackDelete.js
+++ b/_stackDelete.js
@@ -1,4 +1,4 @@
-define(['./assocDelete'], function(assocDelete) {
+define(['./_assocDelete'], function(assocDelete) {
/**
* Removes `key` and its value from the stack.
diff --git a/internal/stackGet.js b/_stackGet.js
similarity index 89%
rename from internal/stackGet.js
rename to _stackGet.js
index 0cee47cfa..9e7a7112d 100644
--- a/internal/stackGet.js
+++ b/_stackGet.js
@@ -1,4 +1,4 @@
-define(['./assocGet'], function(assocGet) {
+define(['./_assocGet'], function(assocGet) {
/**
* Gets the stack value for `key`.
diff --git a/internal/stackHas.js b/_stackHas.js
similarity index 90%
rename from internal/stackHas.js
rename to _stackHas.js
index c2d50af7c..4db729142 100644
--- a/internal/stackHas.js
+++ b/_stackHas.js
@@ -1,4 +1,4 @@
-define(['./assocHas'], function(assocHas) {
+define(['./_assocHas'], function(assocHas) {
/**
* Checks if a stack value for `key` exists.
diff --git a/internal/stackSet.js b/_stackSet.js
similarity index 91%
rename from internal/stackSet.js
rename to _stackSet.js
index 1845a9c8f..9119e004f 100644
--- a/internal/stackSet.js
+++ b/_stackSet.js
@@ -1,4 +1,4 @@
-define(['./MapCache', './assocSet'], function(MapCache, assocSet) {
+define(['./_MapCache', './_assocSet'], function(MapCache, assocSet) {
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
diff --git a/internal/stringSize.js b/_stringSize.js
similarity index 100%
rename from internal/stringSize.js
rename to _stringSize.js
diff --git a/internal/stringToArray.js b/_stringToArray.js
similarity index 100%
rename from internal/stringToArray.js
rename to _stringToArray.js
diff --git a/internal/stringToPath.js b/_stringToPath.js
similarity index 94%
rename from internal/stringToPath.js
rename to _stringToPath.js
index 720d03615..356635e24 100644
--- a/internal/stringToPath.js
+++ b/_stringToPath.js
@@ -1,4 +1,4 @@
-define(['../toString'], function(toString) {
+define(['./toString'], function(toString) {
/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g;
diff --git a/internal/toArrayLikeObject.js b/_toArrayLikeObject.js
similarity index 83%
rename from internal/toArrayLikeObject.js
rename to _toArrayLikeObject.js
index 77ae155d2..97449156f 100644
--- a/internal/toArrayLikeObject.js
+++ b/_toArrayLikeObject.js
@@ -1,4 +1,4 @@
-define(['../isArrayLikeObject'], function(isArrayLikeObject) {
+define(['./isArrayLikeObject'], function(isArrayLikeObject) {
/**
* Converts `value` to an array-like object if it's not one.
diff --git a/internal/toFunction.js b/_toFunction.js
similarity index 86%
rename from internal/toFunction.js
rename to _toFunction.js
index c2e8140c6..07d34f233 100644
--- a/internal/toFunction.js
+++ b/_toFunction.js
@@ -1,4 +1,4 @@
-define(['../identity'], function(identity) {
+define(['./identity'], function(identity) {
/**
* Converts `value` to a function if it's not one.
diff --git a/internal/unescapeHtmlChar.js b/_unescapeHtmlChar.js
similarity index 100%
rename from internal/unescapeHtmlChar.js
rename to _unescapeHtmlChar.js
diff --git a/internal/wrapperClone.js b/_wrapperClone.js
similarity index 83%
rename from internal/wrapperClone.js
rename to _wrapperClone.js
index 23b08ae35..e28ec2072 100644
--- a/internal/wrapperClone.js
+++ b/_wrapperClone.js
@@ -1,4 +1,4 @@
-define(['./LazyWrapper', './LodashWrapper', './copyArray'], function(LazyWrapper, LodashWrapper, copyArray) {
+define(['./_LazyWrapper', './_LodashWrapper', './_copyArray'], function(LazyWrapper, LodashWrapper, copyArray) {
/**
* Creates a clone of `wrapper`.
diff --git a/array.js b/array.js
index f8ab23a85..3ab7b3309 100644
--- a/array.js
+++ b/array.js
@@ -1,4 +1,4 @@
-define(['./chunk', './compact', './concat', './difference', './differenceBy', './differenceWith', './drop', './dropRight', './dropRightWhile', './dropWhile', './fill', './findIndex', './findLastIndex', './flatMap', './flatten', './flattenDeep', './fromPairs', './head', './indexOf', './initial', './intersection', './intersectionBy', './intersectionWith', './join', './last', './lastIndexOf', './pull', './pullAll', './pullAllBy', './pullAt', './remove', './reverse', './slice', './sortedIndex', './sortedIndexBy', './sortedIndexOf', './sortedLastIndex', './sortedLastIndexBy', './sortedLastIndexOf', './sortedUniq', './sortedUniqBy', './tail', './take', './takeRight', './takeRightWhile', './takeWhile', './union', './unionBy', './unionWith', './uniq', './uniqBy', './uniqWith', './unzip', './unzipWith', './without', './xor', './xorBy', './xorWith', './zip', './zipObject', './zipWith'], function(chunk, compact, concat, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, findIndex, findLastIndex, flatMap, flatten, flattenDeep, fromPairs, head, indexOf, initial, intersection, intersectionBy, intersectionWith, join, last, lastIndexOf, pull, pullAll, pullAllBy, pullAt, remove, reverse, slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take, takeRight, takeRightWhile, takeWhile, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, without, xor, xorBy, xorWith, zip, zipObject, zipWith) {
+define(['./chunk', './compact', './concat', './difference', './differenceBy', './differenceWith', './drop', './dropRight', './dropRightWhile', './dropWhile', './fill', './findIndex', './findLastIndex', './flatMap', './flatten', './flattenDeep', './fromPairs', './head', './indexOf', './initial', './intersection', './intersectionBy', './intersectionWith', './join', './last', './lastIndexOf', './pull', './pullAll', './pullAllBy', './pullAt', './remove', './reverse', './slice', './sortedIndex', './sortedIndexBy', './sortedIndexOf', './sortedLastIndex', './sortedLastIndexBy', './sortedLastIndexOf', './sortedUniq', './sortedUniqBy', './tail', './take', './takeRight', './takeRightWhile', './takeWhile', './union', './unionBy', './unionWith', './uniq', './uniqBy', './uniqWith', './unzip', './unzipWith', './without', './xor', './xorBy', './xorWith', './zip', './zipObject', './zipObjectDeep', './zipWith'], function(chunk, compact, concat, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, findIndex, findLastIndex, flatMap, flatten, flattenDeep, fromPairs, head, indexOf, initial, intersection, intersectionBy, intersectionWith, join, last, lastIndexOf, pull, pullAll, pullAllBy, pullAt, remove, reverse, slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take, takeRight, takeRightWhile, takeWhile, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, without, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith) {
return {
'chunk': chunk,
'compact': compact,
@@ -60,6 +60,7 @@ define(['./chunk', './compact', './concat', './difference', './differenceBy', '.
'xorWith': xorWith,
'zip': zip,
'zipObject': zipObject,
+ 'zipObjectDeep': zipObjectDeep,
'zipWith': zipWith
};
});
diff --git a/ary.js b/ary.js
index d9fe1c71a..9b85fe2c7 100644
--- a/ary.js
+++ b/ary.js
@@ -1,4 +1,4 @@
-define(['./internal/createWrapper'], function(createWrapper) {
+define(['./_createWrapper'], function(createWrapper) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/assign.js b/assign.js
index 1152cd3d6..0696aeee6 100644
--- a/assign.js
+++ b/assign.js
@@ -1,4 +1,4 @@
-define(['./internal/copyObject', './internal/createAssigner', './keys'], function(copyObject, createAssigner, keys) {
+define(['./_copyObject', './_createAssigner', './keys'], function(copyObject, createAssigner, keys) {
/**
* Assigns own enumerable properties of source objects to the destination
diff --git a/assignIn.js b/assignIn.js
index 09b3f57fa..3372287fd 100644
--- a/assignIn.js
+++ b/assignIn.js
@@ -1,4 +1,4 @@
-define(['./internal/copyObject', './internal/createAssigner', './keysIn'], function(copyObject, createAssigner, keysIn) {
+define(['./_copyObject', './_createAssigner', './keysIn'], function(copyObject, createAssigner, keysIn) {
/**
* This method is like `_.assign` except that it iterates over own and
diff --git a/assignInWith.js b/assignInWith.js
index 88ccb8811..9a10c99f1 100644
--- a/assignInWith.js
+++ b/assignInWith.js
@@ -1,4 +1,4 @@
-define(['./internal/copyObjectWith', './internal/createAssigner', './keysIn'], function(copyObjectWith, createAssigner, keysIn) {
+define(['./_copyObjectWith', './_createAssigner', './keysIn'], function(copyObjectWith, createAssigner, keysIn) {
/**
* This method is like `_.assignIn` except that it accepts `customizer` which
diff --git a/assignWith.js b/assignWith.js
index b285980b4..d27b26a53 100644
--- a/assignWith.js
+++ b/assignWith.js
@@ -1,4 +1,4 @@
-define(['./internal/copyObjectWith', './internal/createAssigner', './keys'], function(copyObjectWith, createAssigner, keys) {
+define(['./_copyObjectWith', './_createAssigner', './keys'], function(copyObjectWith, createAssigner, keys) {
/**
* This method is like `_.assign` except that it accepts `customizer` which
diff --git a/at.js b/at.js
index 9e0dafb90..7a858d051 100644
--- a/at.js
+++ b/at.js
@@ -1,4 +1,4 @@
-define(['./internal/baseAt', './internal/baseFlatten', './rest'], function(baseAt, baseFlatten, rest) {
+define(['./_baseAt', './_baseFlatten', './rest'], function(baseAt, baseFlatten, rest) {
/**
* Creates an array of values corresponding to `paths` of `object`.
diff --git a/attempt.js b/attempt.js
index 966ab0ad8..282250c27 100644
--- a/attempt.js
+++ b/attempt.js
@@ -1,4 +1,4 @@
-define(['./internal/apply', './isError', './rest'], function(apply, isError, rest) {
+define(['./_apply', './isError', './rest'], function(apply, isError, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/bind.js b/bind.js
index c1545631c..395e6d3d2 100644
--- a/bind.js
+++ b/bind.js
@@ -1,4 +1,4 @@
-define(['./internal/createWrapper', './internal/replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
+define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1,
diff --git a/bindAll.js b/bindAll.js
index a787ccda0..3b137b5f1 100644
--- a/bindAll.js
+++ b/bindAll.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayEach', './internal/baseFlatten', './bind', './rest'], function(arrayEach, baseFlatten, bind, rest) {
+define(['./_arrayEach', './_baseFlatten', './bind', './rest'], function(arrayEach, baseFlatten, bind, rest) {
/**
* Binds methods of an object to the object itself, overwriting the existing
diff --git a/bindKey.js b/bindKey.js
index 79055229d..cc957dbc9 100644
--- a/bindKey.js
+++ b/bindKey.js
@@ -1,4 +1,4 @@
-define(['./internal/createWrapper', './internal/replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
+define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1,
diff --git a/camelCase.js b/camelCase.js
index c3bf8bb2e..b06b737e2 100644
--- a/camelCase.js
+++ b/camelCase.js
@@ -1,4 +1,4 @@
-define(['./capitalize', './internal/createCompounder'], function(capitalize, createCompounder) {
+define(['./capitalize', './_createCompounder'], function(capitalize, createCompounder) {
/**
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
diff --git a/ceil.js b/ceil.js
index 507342488..098cac0c6 100644
--- a/ceil.js
+++ b/ceil.js
@@ -1,4 +1,4 @@
-define(['./internal/createRound'], function(createRound) {
+define(['./_createRound'], function(createRound) {
/**
* Computes `number` rounded up to `precision`.
diff --git a/chunk.js b/chunk.js
index 5f321c187..82530b057 100644
--- a/chunk.js
+++ b/chunk.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSlice', './toInteger'], function(baseSlice, toInteger) {
+define(['./_baseSlice', './toInteger'], function(baseSlice, toInteger) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
diff --git a/clamp.js b/clamp.js
index 0c1fe7ed3..4bdcb6660 100644
--- a/clamp.js
+++ b/clamp.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClamp', './toNumber'], function(baseClamp, toNumber) {
+define(['./_baseClamp', './toNumber'], function(baseClamp, toNumber) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/clone.js b/clone.js
index 91be2203e..78657e4bf 100644
--- a/clone.js
+++ b/clone.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClone'], function(baseClone) {
+define(['./_baseClone'], function(baseClone) {
/**
* Creates a shallow clone of `value`.
diff --git a/cloneDeep.js b/cloneDeep.js
index 2048c109b..5ab86714e 100644
--- a/cloneDeep.js
+++ b/cloneDeep.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClone'], function(baseClone) {
+define(['./_baseClone'], function(baseClone) {
/**
* This method is like `_.clone` except that it recursively clones `value`.
diff --git a/cloneDeepWith.js b/cloneDeepWith.js
index 997986599..4fe4c7780 100644
--- a/cloneDeepWith.js
+++ b/cloneDeepWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClone'], function(baseClone) {
+define(['./_baseClone'], function(baseClone) {
/**
* This method is like `_.cloneWith` except that it recursively clones `value`.
diff --git a/cloneWith.js b/cloneWith.js
index 6726f1b39..36af1b82a 100644
--- a/cloneWith.js
+++ b/cloneWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClone'], function(baseClone) {
+define(['./_baseClone'], function(baseClone) {
/**
* This method is like `_.clone` except that it accepts `customizer` which
diff --git a/commit.js b/commit.js
index f8f082c98..2a86f5a22 100644
--- a/commit.js
+++ b/commit.js
@@ -1,4 +1,4 @@
-define(['./internal/LodashWrapper'], function(LodashWrapper) {
+define(['./_LodashWrapper'], function(LodashWrapper) {
/**
* Executes the chained sequence and returns the wrapped result.
diff --git a/concat.js b/concat.js
index 79283a8b3..be0148e6d 100644
--- a/concat.js
+++ b/concat.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayConcat', './internal/baseFlatten', './isArray', './rest'], function(arrayConcat, baseFlatten, isArray, rest) {
+define(['./_arrayConcat', './_baseFlatten', './isArray', './rest'], function(arrayConcat, baseFlatten, isArray, rest) {
/**
* Creates a new array concatenating `array` with any additional arrays
diff --git a/cond.js b/cond.js
index 5e885f63d..f6a51ef02 100644
--- a/cond.js
+++ b/cond.js
@@ -1,4 +1,4 @@
-define(['./internal/apply', './internal/arrayMap', './internal/baseIteratee', './rest'], function(apply, arrayMap, baseIteratee, rest) {
+define(['./_apply', './_arrayMap', './_baseIteratee', './rest'], function(apply, arrayMap, baseIteratee, rest) {
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
diff --git a/conforms.js b/conforms.js
index 9c042c209..b81341537 100644
--- a/conforms.js
+++ b/conforms.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClone', './internal/baseConforms'], function(baseClone, baseConforms) {
+define(['./_baseClone', './_baseConforms'], function(baseClone, baseConforms) {
/**
* Creates a function that invokes the predicate properties of `source` with
diff --git a/countBy.js b/countBy.js
index bc3c72e51..15f3620dc 100644
--- a/countBy.js
+++ b/countBy.js
@@ -1,4 +1,4 @@
-define(['./internal/createAggregator'], function(createAggregator) {
+define(['./_createAggregator'], function(createAggregator) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
diff --git a/create.js b/create.js
index ebba02bff..1e3d7bfa6 100644
--- a/create.js
+++ b/create.js
@@ -1,4 +1,4 @@
-define(['./internal/baseAssign', './internal/baseCreate'], function(baseAssign, baseCreate) {
+define(['./_baseAssign', './_baseCreate'], function(baseAssign, baseCreate) {
/**
* Creates an object that inherits from the `prototype` object. If a `properties`
diff --git a/curry.js b/curry.js
index 810588509..9b4c258a9 100644
--- a/curry.js
+++ b/curry.js
@@ -1,4 +1,4 @@
-define(['./internal/createWrapper'], function(createWrapper) {
+define(['./_createWrapper'], function(createWrapper) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/curryRight.js b/curryRight.js
index c1d4ea2ea..abd19786f 100644
--- a/curryRight.js
+++ b/curryRight.js
@@ -1,4 +1,4 @@
-define(['./internal/createWrapper'], function(createWrapper) {
+define(['./_createWrapper'], function(createWrapper) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/deburr.js b/deburr.js
index 989209e66..e8f0ae047 100644
--- a/deburr.js
+++ b/deburr.js
@@ -1,4 +1,4 @@
-define(['./internal/deburrLetter', './toString'], function(deburrLetter, toString) {
+define(['./_deburrLetter', './toString'], function(deburrLetter, toString) {
/** Used to match latin-1 supplementary letters (excluding mathematical operators). */
var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
diff --git a/defaults.js b/defaults.js
index d1247afcd..155e2a83f 100644
--- a/defaults.js
+++ b/defaults.js
@@ -1,4 +1,4 @@
-define(['./internal/apply', './internal/assignInDefaults', './assignInWith', './rest'], function(apply, assignInDefaults, assignInWith, rest) {
+define(['./_apply', './_assignInDefaults', './assignInWith', './rest'], function(apply, assignInDefaults, assignInWith, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/defaultsDeep.js b/defaultsDeep.js
index 8c8cff727..d649b5d9c 100644
--- a/defaultsDeep.js
+++ b/defaultsDeep.js
@@ -1,4 +1,4 @@
-define(['./internal/apply', './internal/mergeDefaults', './mergeWith', './rest'], function(apply, mergeDefaults, mergeWith, rest) {
+define(['./_apply', './_mergeDefaults', './mergeWith', './rest'], function(apply, mergeDefaults, mergeWith, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/defer.js b/defer.js
index 540bee383..18aa150e4 100644
--- a/defer.js
+++ b/defer.js
@@ -1,4 +1,4 @@
-define(['./internal/baseDelay', './rest'], function(baseDelay, rest) {
+define(['./_baseDelay', './rest'], function(baseDelay, rest) {
/**
* Defers invoking the `func` until the current call stack has cleared. Any
diff --git a/delay.js b/delay.js
index a780f2960..58a1f7c36 100644
--- a/delay.js
+++ b/delay.js
@@ -1,4 +1,4 @@
-define(['./internal/baseDelay', './rest', './toNumber'], function(baseDelay, rest, toNumber) {
+define(['./_baseDelay', './rest', './toNumber'], function(baseDelay, rest, toNumber) {
/**
* Invokes `func` after `wait` milliseconds. Any additional arguments are
diff --git a/difference.js b/difference.js
index 6c104e962..9c5623f02 100644
--- a/difference.js
+++ b/difference.js
@@ -1,4 +1,4 @@
-define(['./internal/baseDifference', './internal/baseFlatten', './isArrayLikeObject', './rest'], function(baseDifference, baseFlatten, isArrayLikeObject, rest) {
+define(['./_baseDifference', './_baseFlatten', './isArrayLikeObject', './rest'], function(baseDifference, baseFlatten, isArrayLikeObject, rest) {
/**
* Creates an array of unique `array` values not included in the other
diff --git a/differenceBy.js b/differenceBy.js
index b866be8d8..29038b4ee 100644
--- a/differenceBy.js
+++ b/differenceBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseDifference', './internal/baseFlatten', './internal/baseIteratee', './isArrayLikeObject', './last', './rest'], function(baseDifference, baseFlatten, baseIteratee, isArrayLikeObject, last, rest) {
+define(['./_baseDifference', './_baseFlatten', './_baseIteratee', './isArrayLikeObject', './last', './rest'], function(baseDifference, baseFlatten, baseIteratee, isArrayLikeObject, last, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/differenceWith.js b/differenceWith.js
index c2d23f0e1..5df03fc1d 100644
--- a/differenceWith.js
+++ b/differenceWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseDifference', './internal/baseFlatten', './isArrayLikeObject', './last', './rest'], function(baseDifference, baseFlatten, isArrayLikeObject, last, rest) {
+define(['./_baseDifference', './_baseFlatten', './isArrayLikeObject', './last', './rest'], function(baseDifference, baseFlatten, isArrayLikeObject, last, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/drop.js b/drop.js
index d1b5d6d4f..a2a6b8e6b 100644
--- a/drop.js
+++ b/drop.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSlice', './toInteger'], function(baseSlice, toInteger) {
+define(['./_baseSlice', './toInteger'], function(baseSlice, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/dropRight.js b/dropRight.js
index 5dac9a39a..8606dff7e 100644
--- a/dropRight.js
+++ b/dropRight.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSlice', './toInteger'], function(baseSlice, toInteger) {
+define(['./_baseSlice', './toInteger'], function(baseSlice, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/dropRightWhile.js b/dropRightWhile.js
index b660b589b..eaf43dc7d 100644
--- a/dropRightWhile.js
+++ b/dropRightWhile.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/baseWhile'], function(baseIteratee, baseWhile) {
+define(['./_baseIteratee', './_baseWhile'], function(baseIteratee, baseWhile) {
/**
* Creates a slice of `array` excluding elements dropped from the end.
diff --git a/dropWhile.js b/dropWhile.js
index 054cae5b1..be3d3079a 100644
--- a/dropWhile.js
+++ b/dropWhile.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/baseWhile'], function(baseIteratee, baseWhile) {
+define(['./_baseIteratee', './_baseWhile'], function(baseIteratee, baseWhile) {
/**
* Creates a slice of `array` excluding elements dropped from the beginning.
diff --git a/endsWith.js b/endsWith.js
index 149dab687..6cf8afb1a 100644
--- a/endsWith.js
+++ b/endsWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClamp', './toInteger', './toString'], function(baseClamp, toInteger, toString) {
+define(['./_baseClamp', './toInteger', './toString'], function(baseClamp, toInteger, toString) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/escape.js b/escape.js
index b270a8858..ef8a049cf 100644
--- a/escape.js
+++ b/escape.js
@@ -1,4 +1,4 @@
-define(['./internal/escapeHtmlChar', './toString'], function(escapeHtmlChar, toString) {
+define(['./_escapeHtmlChar', './toString'], function(escapeHtmlChar, toString) {
/** Used to match HTML entities and HTML characters. */
var reUnescapedHtml = /[&<>"'`]/g,
diff --git a/every.js b/every.js
index 56961ed47..0ffef4ad1 100644
--- a/every.js
+++ b/every.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayEvery', './internal/baseEvery', './internal/baseIteratee', './isArray', './internal/isIterateeCall'], function(arrayEvery, baseEvery, baseIteratee, isArray, isIterateeCall) {
+define(['./_arrayEvery', './_baseEvery', './_baseIteratee', './isArray', './_isIterateeCall'], function(arrayEvery, baseEvery, baseIteratee, isArray, isIterateeCall) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/fill.js b/fill.js
index 1bd870271..37832f6b3 100644
--- a/fill.js
+++ b/fill.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFill', './internal/isIterateeCall'], function(baseFill, isIterateeCall) {
+define(['./_baseFill', './_isIterateeCall'], function(baseFill, isIterateeCall) {
/**
* Fills elements of `array` with `value` from `start` up to, but not
diff --git a/filter.js b/filter.js
index 596d31b5e..3a4edd500 100644
--- a/filter.js
+++ b/filter.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayFilter', './internal/baseFilter', './internal/baseIteratee', './isArray'], function(arrayFilter, baseFilter, baseIteratee, isArray) {
+define(['./_arrayFilter', './_baseFilter', './_baseIteratee', './isArray'], function(arrayFilter, baseFilter, baseIteratee, isArray) {
/**
* Iterates over elements of `collection`, returning an array of all elements
diff --git a/find.js b/find.js
index a944af14e..a8c746ed5 100644
--- a/find.js
+++ b/find.js
@@ -1,4 +1,4 @@
-define(['./internal/baseEach', './internal/baseFind', './internal/baseFindIndex', './internal/baseIteratee', './isArray'], function(baseEach, baseFind, baseFindIndex, baseIteratee, isArray) {
+define(['./_baseEach', './_baseFind', './_baseFindIndex', './_baseIteratee', './isArray'], function(baseEach, baseFind, baseFindIndex, baseIteratee, isArray) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/findIndex.js b/findIndex.js
index e90650b18..23ccb065c 100644
--- a/findIndex.js
+++ b/findIndex.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFindIndex', './internal/baseIteratee'], function(baseFindIndex, baseIteratee) {
+define(['./_baseFindIndex', './_baseIteratee'], function(baseFindIndex, baseIteratee) {
/**
* This method is like `_.find` except that it returns the index of the first
diff --git a/findKey.js b/findKey.js
index 2afa442d7..1427f1d65 100644
--- a/findKey.js
+++ b/findKey.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFind', './internal/baseForOwn', './internal/baseIteratee'], function(baseFind, baseForOwn, baseIteratee) {
+define(['./_baseFind', './_baseForOwn', './_baseIteratee'], function(baseFind, baseForOwn, baseIteratee) {
/**
* This method is like `_.find` except that it returns the key of the first
diff --git a/findLast.js b/findLast.js
index 6a22449b9..3eb730243 100644
--- a/findLast.js
+++ b/findLast.js
@@ -1,4 +1,4 @@
-define(['./internal/baseEachRight', './internal/baseFind', './internal/baseFindIndex', './internal/baseIteratee', './isArray'], function(baseEachRight, baseFind, baseFindIndex, baseIteratee, isArray) {
+define(['./_baseEachRight', './_baseFind', './_baseFindIndex', './_baseIteratee', './isArray'], function(baseEachRight, baseFind, baseFindIndex, baseIteratee, isArray) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/findLastIndex.js b/findLastIndex.js
index 3568dd2de..17d08bf33 100644
--- a/findLastIndex.js
+++ b/findLastIndex.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFindIndex', './internal/baseIteratee'], function(baseFindIndex, baseIteratee) {
+define(['./_baseFindIndex', './_baseIteratee'], function(baseFindIndex, baseIteratee) {
/**
* This method is like `_.findIndex` except that it iterates over elements
diff --git a/findLastKey.js b/findLastKey.js
index 8b7c5e7ec..f452b0bea 100644
--- a/findLastKey.js
+++ b/findLastKey.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFind', './internal/baseForOwnRight', './internal/baseIteratee'], function(baseFind, baseForOwnRight, baseIteratee) {
+define(['./_baseFind', './_baseForOwnRight', './_baseIteratee'], function(baseFind, baseForOwnRight, baseIteratee) {
/**
* This method is like `_.findKey` except that it iterates over elements of
diff --git a/flatMap.js b/flatMap.js
index 8268363ea..f05b36390 100644
--- a/flatMap.js
+++ b/flatMap.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayMap', './internal/baseFlatten', './internal/baseIteratee'], function(arrayMap, baseFlatten, baseIteratee) {
+define(['./_arrayMap', './_baseFlatten', './_baseIteratee'], function(arrayMap, baseFlatten, baseIteratee) {
/**
* Creates an array of flattened values by running each element in `array`
diff --git a/flatten.js b/flatten.js
index 12117b0b6..e58f913bc 100644
--- a/flatten.js
+++ b/flatten.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFlatten'], function(baseFlatten) {
+define(['./_baseFlatten'], function(baseFlatten) {
/**
* Flattens `array` a single level.
diff --git a/flattenDeep.js b/flattenDeep.js
index 6f2605077..ebbd3fcda 100644
--- a/flattenDeep.js
+++ b/flattenDeep.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFlatten'], function(baseFlatten) {
+define(['./_baseFlatten'], function(baseFlatten) {
/**
* This method is like `_.flatten` except that it recursively flattens `array`.
diff --git a/flip.js b/flip.js
index 69c527d1f..0d84d58e8 100644
--- a/flip.js
+++ b/flip.js
@@ -1,4 +1,4 @@
-define(['./internal/createWrapper'], function(createWrapper) {
+define(['./_createWrapper'], function(createWrapper) {
/** Used to compose bitmasks for wrapper metadata. */
var FLIP_FLAG = 512;
diff --git a/floor.js b/floor.js
index e5c4fe812..064867a71 100644
--- a/floor.js
+++ b/floor.js
@@ -1,4 +1,4 @@
-define(['./internal/createRound'], function(createRound) {
+define(['./_createRound'], function(createRound) {
/**
* Computes `number` rounded down to `precision`.
diff --git a/flow.js b/flow.js
index b9c223bf8..215204c6a 100644
--- a/flow.js
+++ b/flow.js
@@ -1,4 +1,4 @@
-define(['./internal/createFlow'], function(createFlow) {
+define(['./_createFlow'], function(createFlow) {
/**
* Creates a function that returns the result of invoking the provided
diff --git a/flowRight.js b/flowRight.js
index d264208bc..a8bb87b02 100644
--- a/flowRight.js
+++ b/flowRight.js
@@ -1,4 +1,4 @@
-define(['./internal/createFlow'], function(createFlow) {
+define(['./_createFlow'], function(createFlow) {
/**
* This method is like `_.flow` except that it creates a function that
diff --git a/forEach.js b/forEach.js
index f78234c9b..da1867cc9 100644
--- a/forEach.js
+++ b/forEach.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayEach', './internal/baseEach', './isArray', './internal/toFunction'], function(arrayEach, baseEach, isArray, toFunction) {
+define(['./_arrayEach', './_baseEach', './isArray', './_toFunction'], function(arrayEach, baseEach, isArray, toFunction) {
/**
* Iterates over elements of `collection` invoking `iteratee` for each element.
diff --git a/forEachRight.js b/forEachRight.js
index 5361ec4e0..4123efaed 100644
--- a/forEachRight.js
+++ b/forEachRight.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayEachRight', './internal/baseEachRight', './isArray', './internal/toFunction'], function(arrayEachRight, baseEachRight, isArray, toFunction) {
+define(['./_arrayEachRight', './_baseEachRight', './isArray', './_toFunction'], function(arrayEachRight, baseEachRight, isArray, toFunction) {
/**
* This method is like `_.forEach` except that it iterates over elements of
diff --git a/forIn.js b/forIn.js
index 1be3f1ae8..d447f5a22 100644
--- a/forIn.js
+++ b/forIn.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFor', './keysIn', './internal/toFunction'], function(baseFor, keysIn, toFunction) {
+define(['./_baseFor', './keysIn', './_toFunction'], function(baseFor, keysIn, toFunction) {
/**
* Iterates over own and inherited enumerable properties of an object invoking
diff --git a/forInRight.js b/forInRight.js
index 84042b36a..e961ae670 100644
--- a/forInRight.js
+++ b/forInRight.js
@@ -1,4 +1,4 @@
-define(['./internal/baseForRight', './keysIn', './internal/toFunction'], function(baseForRight, keysIn, toFunction) {
+define(['./_baseForRight', './keysIn', './_toFunction'], function(baseForRight, keysIn, toFunction) {
/**
* This method is like `_.forIn` except that it iterates over properties of
diff --git a/forOwn.js b/forOwn.js
index 175d7a925..96d6f477d 100644
--- a/forOwn.js
+++ b/forOwn.js
@@ -1,4 +1,4 @@
-define(['./internal/baseForOwn', './internal/toFunction'], function(baseForOwn, toFunction) {
+define(['./_baseForOwn', './_toFunction'], function(baseForOwn, toFunction) {
/**
* Iterates over own enumerable properties of an object invoking `iteratee`
diff --git a/forOwnRight.js b/forOwnRight.js
index 54408eb5b..ef995a11c 100644
--- a/forOwnRight.js
+++ b/forOwnRight.js
@@ -1,4 +1,4 @@
-define(['./internal/baseForOwnRight', './internal/toFunction'], function(baseForOwnRight, toFunction) {
+define(['./_baseForOwnRight', './_toFunction'], function(baseForOwnRight, toFunction) {
/**
* This method is like `_.forOwn` except that it iterates over properties of
diff --git a/functions.js b/functions.js
index 0b7d89597..7ccd1e515 100644
--- a/functions.js
+++ b/functions.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFunctions', './keys'], function(baseFunctions, keys) {
+define(['./_baseFunctions', './keys'], function(baseFunctions, keys) {
/**
* Creates an array of function property names from own enumerable properties
diff --git a/functionsIn.js b/functionsIn.js
index 45a19097a..20c2caa11 100644
--- a/functionsIn.js
+++ b/functionsIn.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFunctions', './keysIn'], function(baseFunctions, keysIn) {
+define(['./_baseFunctions', './keysIn'], function(baseFunctions, keysIn) {
/**
* Creates an array of function property names from own and inherited
diff --git a/get.js b/get.js
index 7fbf7a18c..2b941ace8 100644
--- a/get.js
+++ b/get.js
@@ -1,4 +1,4 @@
-define(['./internal/baseGet'], function(baseGet) {
+define(['./_baseGet'], function(baseGet) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/groupBy.js b/groupBy.js
index 68a972b44..bfd42c01a 100644
--- a/groupBy.js
+++ b/groupBy.js
@@ -1,4 +1,4 @@
-define(['./internal/createAggregator'], function(createAggregator) {
+define(['./_createAggregator'], function(createAggregator) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
diff --git a/has.js b/has.js
index b1d178157..f0812455c 100644
--- a/has.js
+++ b/has.js
@@ -1,4 +1,4 @@
-define(['./internal/baseHas', './internal/hasPath'], function(baseHas, hasPath) {
+define(['./_baseHas', './_hasPath'], function(baseHas, hasPath) {
/**
* Checks if `path` is a direct property of `object`.
diff --git a/hasIn.js b/hasIn.js
index c389fcc9c..3dd30ca39 100644
--- a/hasIn.js
+++ b/hasIn.js
@@ -1,4 +1,4 @@
-define(['./internal/baseHasIn', './internal/hasPath'], function(baseHasIn, hasPath) {
+define(['./_baseHasIn', './_hasPath'], function(baseHasIn, hasPath) {
/**
* Checks if `path` is a direct or inherited property of `object`.
diff --git a/inRange.js b/inRange.js
index ac9b80b16..8b90e0236 100644
--- a/inRange.js
+++ b/inRange.js
@@ -1,4 +1,4 @@
-define(['./internal/baseInRange', './toNumber'], function(baseInRange, toNumber) {
+define(['./_baseInRange', './toNumber'], function(baseInRange, toNumber) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/includes.js b/includes.js
index f307dec15..e6f737099 100644
--- a/includes.js
+++ b/includes.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIndexOf', './isArrayLike', './isString', './toInteger', './values'], function(baseIndexOf, isArrayLike, isString, toInteger, values) {
+define(['./_baseIndexOf', './isArrayLike', './isString', './toInteger', './values'], function(baseIndexOf, isArrayLike, isString, toInteger, values) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
diff --git a/indexOf.js b/indexOf.js
index 2d47efd8a..546af4d64 100644
--- a/indexOf.js
+++ b/indexOf.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIndexOf', './toInteger'], function(baseIndexOf, toInteger) {
+define(['./_baseIndexOf', './toInteger'], function(baseIndexOf, toInteger) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
diff --git a/internal/createAggregator.js b/internal/createAggregator.js
deleted file mode 100644
index 55a15cb0c..000000000
--- a/internal/createAggregator.js
+++ /dev/null
@@ -1,34 +0,0 @@
-define(['./baseEach', './baseIteratee', '../isArray'], function(baseEach, baseIteratee, isArray) {
-
- /**
- * Creates a function like `_.groupBy`.
- *
- * @private
- * @param {Function} setter The function to set keys and values of the accumulator object.
- * @param {Function} [initializer] The function to initialize the accumulator object.
- * @returns {Function} Returns the new aggregator function.
- */
- function createAggregator(setter, initializer) {
- return function(collection, iteratee) {
- var result = initializer ? initializer() : {};
- iteratee = baseIteratee(iteratee);
-
- if (isArray(collection)) {
- var index = -1,
- length = collection.length;
-
- while (++index < length) {
- var value = collection[index];
- setter(result, value, iteratee(value), collection);
- }
- } else {
- baseEach(collection, function(value, key, collection) {
- setter(result, value, iteratee(value), collection);
- });
- }
- return result;
- };
- }
-
- return createAggregator;
-});
diff --git a/intersection.js b/intersection.js
index c7bcd1993..7ecbf34b3 100644
--- a/intersection.js
+++ b/intersection.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayMap', './internal/baseIntersection', './rest', './internal/toArrayLikeObject'], function(arrayMap, baseIntersection, rest, toArrayLikeObject) {
+define(['./_arrayMap', './_baseIntersection', './rest', './_toArrayLikeObject'], function(arrayMap, baseIntersection, rest, toArrayLikeObject) {
/**
* Creates an array of unique values that are included in all of the provided
diff --git a/intersectionBy.js b/intersectionBy.js
index c7877cfd2..f58b4a320 100644
--- a/intersectionBy.js
+++ b/intersectionBy.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayMap', './internal/baseIntersection', './internal/baseIteratee', './last', './rest', './internal/toArrayLikeObject'], function(arrayMap, baseIntersection, baseIteratee, last, rest, toArrayLikeObject) {
+define(['./_arrayMap', './_baseIntersection', './_baseIteratee', './last', './rest', './_toArrayLikeObject'], function(arrayMap, baseIntersection, baseIteratee, last, rest, toArrayLikeObject) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/intersectionWith.js b/intersectionWith.js
index 76c8ed0fd..9a64a87e9 100644
--- a/intersectionWith.js
+++ b/intersectionWith.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayMap', './internal/baseIntersection', './last', './rest', './internal/toArrayLikeObject'], function(arrayMap, baseIntersection, last, rest, toArrayLikeObject) {
+define(['./_arrayMap', './_baseIntersection', './last', './rest', './_toArrayLikeObject'], function(arrayMap, baseIntersection, last, rest, toArrayLikeObject) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/invert.js b/invert.js
index 541011005..b331b33f1 100644
--- a/invert.js
+++ b/invert.js
@@ -1,22 +1,14 @@
-define(['./internal/arrayReduce', './keys'], function(arrayReduce, keys) {
-
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
-
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
+define(['./constant', './_createInverter', './identity'], function(constant, createInverter, identity) {
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite property
- * assignments of previous values unless `multiVal` is `true`.
+ * assignments of previous values.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to invert.
- * @param {boolean} [multiVal] Allow multiple values per key.
- * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Object} Returns the new inverted object.
* @example
*
@@ -24,27 +16,10 @@ define(['./internal/arrayReduce', './keys'], function(arrayReduce, keys) {
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
- *
- * // with `multiVal`
- * _.invert(object, true);
- * // => { '1': ['a', 'c'], '2': ['b'] }
*/
- function invert(object, multiVal, guard) {
- return arrayReduce(keys(object), function(result, key) {
- var value = object[key];
- if (multiVal && !guard) {
- if (hasOwnProperty.call(result, value)) {
- result[value].push(key);
- } else {
- result[value] = [key];
- }
- }
- else {
- result[value] = key;
- }
- return result;
- }, {});
- }
+ var invert = createInverter(function(result, value, key) {
+ result[value] = key;
+ }, constant(identity));
return invert;
});
diff --git a/invertBy.js b/invertBy.js
new file mode 100644
index 000000000..6ebd392ac
--- /dev/null
+++ b/invertBy.js
@@ -0,0 +1,43 @@
+define(['./_baseIteratee', './_createInverter'], function(baseIteratee, createInverter) {
+
+ /** Used for built-in method references. */
+ var objectProto = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty = objectProto.hasOwnProperty;
+
+ /**
+ * This method is like `_.invert` except that the inverted object is generated
+ * from the results of running each element of `object` through `iteratee`.
+ * The corresponding inverted value of each inverted key is an array of keys
+ * responsible for generating the inverted value. The iteratee is invoked
+ * with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to invert.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Object} Returns the new inverted object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2, 'c': 1 };
+ *
+ * _.invertBy(object);
+ * // => { '1': ['a', 'c'], '2': ['b'] }
+ *
+ * _.invertBy(object, function(value) {
+ * return 'group' + value;
+ * });
+ * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
+ */
+ var invertBy = createInverter(function(result, value, key) {
+ if (hasOwnProperty.call(result, value)) {
+ result[value].push(key);
+ } else {
+ result[value] = [key];
+ }
+ }, baseIteratee);
+
+ return invertBy;
+});
diff --git a/invoke.js b/invoke.js
index 757233776..c625c650b 100644
--- a/invoke.js
+++ b/invoke.js
@@ -1,4 +1,4 @@
-define(['./internal/baseInvoke', './rest'], function(baseInvoke, rest) {
+define(['./_baseInvoke', './rest'], function(baseInvoke, rest) {
/**
* Invokes the method at `path` of `object`.
diff --git a/invokeMap.js b/invokeMap.js
index d8a23cc7e..b957dfe0b 100644
--- a/invokeMap.js
+++ b/invokeMap.js
@@ -1,4 +1,4 @@
-define(['./internal/apply', './internal/baseEach', './internal/baseInvoke', './isArrayLike', './internal/isKey', './rest'], function(apply, baseEach, baseInvoke, isArrayLike, isKey, rest) {
+define(['./_apply', './_baseEach', './_baseInvoke', './isArrayLike', './_isKey', './rest'], function(apply, baseEach, baseInvoke, isArrayLike, isKey, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/isArrayLike.js b/isArrayLike.js
index 4747c3dcd..dc803c03f 100644
--- a/isArrayLike.js
+++ b/isArrayLike.js
@@ -1,4 +1,4 @@
-define(['./internal/getLength', './isFunction', './isLength'], function(getLength, isFunction, isLength) {
+define(['./_getLength', './isFunction', './isLength'], function(getLength, isFunction, isLength) {
/**
* Checks if `value` is array-like. A value is considered array-like if it's
diff --git a/isEmpty.js b/isEmpty.js
index fcb586a6e..ef45c34c7 100644
--- a/isEmpty.js
+++ b/isEmpty.js
@@ -1,4 +1,10 @@
-define(['./isFunction', './isObjectLike', './keys', './size'], function(isFunction, isObjectLike, keys, size) {
+define(['./isArguments', './isArray', './isArrayLike', './isFunction', './isString'], function(isArguments, isArray, isArrayLike, isFunction, isString) {
+
+ /** Used for built-in method references. */
+ var objectProto = Object.prototype;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if `value` is empty. A value is considered empty unless it's an
@@ -28,9 +34,16 @@ define(['./isFunction', './isObjectLike', './keys', './size'], function(isFuncti
* // => false
*/
function isEmpty(value) {
- return (!isObjectLike(value) || isFunction(value.splice))
- ? !size(value)
- : !keys(value).length;
+ if (isArrayLike(value) &&
+ (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) {
+ return !value.length;
+ }
+ for (var key in value) {
+ if (hasOwnProperty.call(value, key)) {
+ return false;
+ }
+ }
+ return true;
}
return isEmpty;
diff --git a/isEqual.js b/isEqual.js
index b1e37500e..89553b931 100644
--- a/isEqual.js
+++ b/isEqual.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIsEqual'], function(baseIsEqual) {
+define(['./_baseIsEqual'], function(baseIsEqual) {
/**
* Performs a deep comparison between two values to determine if they are
diff --git a/isEqualWith.js b/isEqualWith.js
index 3cc3724af..b0fcd2f18 100644
--- a/isEqualWith.js
+++ b/isEqualWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIsEqual'], function(baseIsEqual) {
+define(['./_baseIsEqual'], function(baseIsEqual) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/isFinite.js b/isFinite.js
index 7ffa8754f..f741ebd21 100644
--- a/isFinite.js
+++ b/isFinite.js
@@ -1,4 +1,4 @@
-define(['./internal/root'], function(root) {
+define(['./_root'], function(root) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsFinite = root.isFinite;
diff --git a/isMatch.js b/isMatch.js
index 3260dd10c..0dcbf5f30 100644
--- a/isMatch.js
+++ b/isMatch.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIsMatch', './internal/getMatchData'], function(baseIsMatch, getMatchData) {
+define(['./_baseIsMatch', './_getMatchData'], function(baseIsMatch, getMatchData) {
/**
* Performs a deep comparison between `object` and `source` to determine if
diff --git a/isMatchWith.js b/isMatchWith.js
index f42d09106..a3fd2f0b9 100644
--- a/isMatchWith.js
+++ b/isMatchWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIsMatch', './internal/getMatchData'], function(baseIsMatch, getMatchData) {
+define(['./_baseIsMatch', './_getMatchData'], function(baseIsMatch, getMatchData) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/isNative.js b/isNative.js
index 02c6183be..eeef4e41b 100644
--- a/isNative.js
+++ b/isNative.js
@@ -1,4 +1,4 @@
-define(['./isFunction', './internal/isHostObject', './isObjectLike'], function(isFunction, isHostObject, isObjectLike) {
+define(['./isFunction', './_isHostObject', './isObjectLike'], function(isFunction, isHostObject, isObjectLike) {
/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
diff --git a/isObject.js b/isObject.js
index 099c756d3..7e9fed50f 100644
--- a/isObject.js
+++ b/isObject.js
@@ -24,8 +24,6 @@ define([], function() {
* // => false
*/
function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
diff --git a/isPlainObject.js b/isPlainObject.js
index 20c0b4d80..d8357978e 100644
--- a/isPlainObject.js
+++ b/isPlainObject.js
@@ -1,4 +1,4 @@
-define(['./internal/isHostObject', './isObjectLike'], function(isHostObject, isObjectLike) {
+define(['./_isHostObject', './isObjectLike'], function(isHostObject, isObjectLike) {
/** `Object#toString` result references. */
var objectTag = '[object Object]';
diff --git a/iteratee.js b/iteratee.js
index d6095c163..48c8bdeec 100644
--- a/iteratee.js
+++ b/iteratee.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './isArray', './isObjectLike', './matches'], function(baseIteratee, isArray, isObjectLike, matches) {
+define(['./_baseIteratee', './isArray', './isObjectLike', './matches'], function(baseIteratee, isArray, isObjectLike, matches) {
/**
* Creates a function that invokes `func` with the arguments of the created
diff --git a/kebabCase.js b/kebabCase.js
index 7a0230c41..649241059 100644
--- a/kebabCase.js
+++ b/kebabCase.js
@@ -1,4 +1,4 @@
-define(['./internal/createCompounder'], function(createCompounder) {
+define(['./_createCompounder'], function(createCompounder) {
/**
* Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
diff --git a/keyBy.js b/keyBy.js
index 2c08c54ae..70d19d1a2 100644
--- a/keyBy.js
+++ b/keyBy.js
@@ -1,4 +1,4 @@
-define(['./internal/createAggregator'], function(createAggregator) {
+define(['./_createAggregator'], function(createAggregator) {
/**
* Creates an object composed of keys generated from the results of running
@@ -14,17 +14,17 @@ define(['./internal/createAggregator'], function(createAggregator) {
* @returns {Object} Returns the composed aggregate object.
* @example
*
- * var keyData = [
+ * var array = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
- * _.keyBy(keyData, function(o) {
+ * _.keyBy(array, function(o) {
* return String.fromCharCode(o.code);
* });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
- * _.keyBy(keyData, 'dir');
+ * _.keyBy(array, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*/
var keyBy = createAggregator(function(result, value, key) {
diff --git a/keys.js b/keys.js
index 70a3ee209..43bf2cda9 100644
--- a/keys.js
+++ b/keys.js
@@ -1,4 +1,4 @@
-define(['./internal/baseHas', './internal/baseKeys', './internal/indexKeys', './isArrayLike', './internal/isIndex', './internal/isPrototype'], function(baseHas, baseKeys, indexKeys, isArrayLike, isIndex, isPrototype) {
+define(['./_baseHas', './_baseKeys', './_indexKeys', './isArrayLike', './_isIndex', './_isPrototype'], function(baseHas, baseKeys, indexKeys, isArrayLike, isIndex, isPrototype) {
/**
* Creates an array of the own enumerable property names of `object`.
diff --git a/keysIn.js b/keysIn.js
index a646c8308..da87e01f6 100644
--- a/keysIn.js
+++ b/keysIn.js
@@ -1,4 +1,4 @@
-define(['./internal/baseKeysIn', './internal/indexKeys', './internal/isIndex', './internal/isPrototype'], function(baseKeysIn, indexKeys, isIndex, isPrototype) {
+define(['./_baseKeysIn', './_indexKeys', './_isIndex', './_isPrototype'], function(baseKeysIn, indexKeys, isIndex, isPrototype) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
diff --git a/lastIndexOf.js b/lastIndexOf.js
index fa52de315..e22f21f3b 100644
--- a/lastIndexOf.js
+++ b/lastIndexOf.js
@@ -1,4 +1,4 @@
-define(['./internal/indexOfNaN', './toInteger'], function(indexOfNaN, toInteger) {
+define(['./_indexOfNaN', './toInteger'], function(indexOfNaN, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/lowerCase.js b/lowerCase.js
index 5480a421a..f544df6bd 100644
--- a/lowerCase.js
+++ b/lowerCase.js
@@ -1,4 +1,4 @@
-define(['./internal/createCompounder'], function(createCompounder) {
+define(['./_createCompounder'], function(createCompounder) {
/**
* Converts `string`, as space separated words, to lower case.
diff --git a/lowerFirst.js b/lowerFirst.js
index 59f29bcdf..48eef6e5f 100644
--- a/lowerFirst.js
+++ b/lowerFirst.js
@@ -1,4 +1,4 @@
-define(['./internal/createCaseFirst'], function(createCaseFirst) {
+define(['./_createCaseFirst'], function(createCaseFirst) {
/**
* Converts the first character of `string` to lower case.
diff --git a/main.js b/main.js
index ab0861a85..74c3dbac4 100644
--- a/main.js
+++ b/main.js
@@ -1,6 +1,6 @@
/**
* @license
- * lodash 4.0.1 (Custom Build)
+ * lodash 4.1.0 (Custom Build)
* Build: `lodash exports="amd" -d -o ./main.js`
* Copyright 2012-2016 The Dojo Foundation
* Based on Underscore.js 1.8.3
@@ -13,7 +13,7 @@
var undefined;
/** Used as the semantic version number. */
- var VERSION = '4.0.1';
+ var VERSION = '4.1.0';
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1,
@@ -408,6 +408,27 @@
return func.apply(thisArg, args);
}
+ /**
+ * A specialized version of `baseAggregator` for arrays.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform keys.
+ * @param {Object} accumulator The initial aggregated object.
+ * @returns {Function} Returns `accumulator`.
+ */
+ function arrayAggregator(array, setter, iteratee, accumulator) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ var value = array[index];
+ setter(accumulator, value, iteratee(value), array);
+ }
+ return accumulator;
+ }
+
/**
* Creates a new array concatenating `array` with `other`.
*
@@ -817,7 +838,7 @@
result = result === undefined ? current : (result + current);
}
}
- return result;
+ return length ? result : 0;
}
/**
@@ -1375,20 +1396,21 @@
* `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`,
* `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`,
* `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`,
- * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`,
- * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,
- * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,
- * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,
- * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,
- * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,
- * `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`,
- * `reject`, `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`,
- * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`,
- * `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`,
- * `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`,
- * `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`,
- * `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `without`,
- * `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, and `zipWith`
+ * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`,
+ * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`,
+ * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`,
+ * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`,
+ * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`,
+ * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`,
+ * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`,
+ * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,
+ * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,
+ * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,
+ * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,
+ * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,
+ * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`,
+ * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,
+ * `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
@@ -2120,6 +2142,24 @@
}
}
+ /**
+ * Aggregates elements of `collection` on `accumulator` with keys transformed
+ * by `iteratee` and values set by `setter`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform keys.
+ * @param {Object} accumulator The initial aggregated object.
+ * @returns {Function} Returns `accumulator`.
+ */
+ function baseAggregator(collection, setter, iteratee, accumulator) {
+ baseEach(collection, function(value, key, collection) {
+ setter(accumulator, value, iteratee(value), collection);
+ });
+ return accumulator;
+ }
+
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
@@ -2666,6 +2706,24 @@
return result;
}
+ /**
+ * The base implementation of `_.invert` and `_.invertBy` which inverts
+ * `object` with values transformed by `iteratee` and set by `setter`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform values.
+ * @param {Object} accumulator The initial inverted object.
+ * @returns {Function} Returns `accumulator`.
+ */
+ function baseInverter(object, setter, iteratee, accumulator) {
+ baseForOwn(object, function(value, key, object) {
+ setter(accumulator, iteratee(value), key, object);
+ });
+ return accumulator;
+ }
+
/**
* The base implementation of `_.invoke` without support for individual
* method arguments.
@@ -2996,7 +3054,7 @@
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = object[key],
srcValue = source[key],
- stacked = stack.get(srcValue) || stack.get(objValue);
+ stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object, key, stacked);
@@ -3015,6 +3073,7 @@
newValue = copyArray(objValue);
}
else {
+ isCommon = false;
newValue = baseClone(srcValue);
}
}
@@ -3023,6 +3082,7 @@
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
+ isCommon = false;
newValue = baseClone(srcValue);
}
else {
@@ -3623,6 +3683,27 @@
return (result && result.length) ? baseUniq(result, iteratee, comparator) : [];
}
+ /**
+ * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
+ *
+ * @private
+ * @param {Array} props The property names.
+ * @param {Array} values The property values.
+ * @param {Function} assignFunc The function to assign values.
+ * @returns {Object} Returns the new object.
+ */
+ function baseZipObject(props, values, assignFunc) {
+ var index = -1,
+ length = props.length,
+ valsLength = values.length,
+ result = {};
+
+ while (++index < length) {
+ assignFunc(result, props[index], index < valsLength ? values[index] : undefined);
+ }
+ return result;
+ }
+
/**
* Creates a clone of `buffer`.
*
@@ -3840,29 +3921,16 @@
* Creates a function like `_.groupBy`.
*
* @private
- * @param {Function} setter The function to set keys and values of the accumulator object.
- * @param {Function} [initializer] The function to initialize the accumulator object.
+ * @param {Function} setter The function to set accumulator values.
+ * @param {Function} [initializer] The accumulator object initializer.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter, initializer) {
return function(collection, iteratee) {
- var result = initializer ? initializer() : {};
- iteratee = getIteratee(iteratee);
+ var func = isArray(collection) ? arrayAggregator : baseAggregator,
+ accumulator = initializer ? initializer() : {};
- if (isArray(collection)) {
- var index = -1,
- length = collection.length;
-
- while (++index < length) {
- var value = collection[index];
- setter(result, value, iteratee(value), collection);
- }
- } else {
- baseEach(collection, function(value, key, collection) {
- setter(result, value, iteratee(value), collection);
- });
- }
- return result;
+ return func(collection, setter, getIteratee(iteratee), accumulator);
};
}
@@ -4195,6 +4263,20 @@
return wrapper;
}
+ /**
+ * Creates a function like `_.invertBy`.
+ *
+ * @private
+ * @param {Function} setter The function to set accumulator values.
+ * @param {Function} toIteratee The function to resolve iteratees.
+ * @returns {Function} Returns the new inverter function.
+ */
+ function createInverter(setter, toIteratee) {
+ return function(object, iteratee) {
+ return baseInverter(object, setter, toIteratee(iteratee), {});
+ };
+ }
+
/**
* Creates a function like `_.over`.
*
@@ -4837,8 +4919,11 @@
result = hasFunc(object, path);
}
}
- return result || (isLength(object && object.length) && isIndex(path, object.length) &&
- (isArray(object) || isString(object) || isArguments(object)));
+ var length = object ? object.length : undefined;
+ return result || (
+ !!length && isLength(length) && isIndex(path, length) &&
+ (isArray(object) || isString(object) || isArguments(object))
+ );
}
/**
@@ -4868,6 +4953,9 @@
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
+ if (isPrototype(object)) {
+ return {};
+ }
var Ctor = object.constructor;
return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
}
@@ -4927,9 +5015,11 @@
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
- return (isLength(length) && (isArray(object) || isString(object) || isArguments(object)))
- ? baseTimes(length, String)
- : null;
+ if (isLength(length) &&
+ (isArray(object) || isString(object) || isArguments(object))) {
+ return baseTimes(length, String);
+ }
+ return null;
}
/**
@@ -6905,19 +6995,29 @@
* @returns {Object} Returns the new object.
* @example
*
- * _.zipObject(['fred', 'barney'], [30, 40]);
- * // => { 'fred': 30, 'barney': 40 }
+ * _.zipObject(['a', 'b'], [1, 2]);
+ * // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
- var index = -1,
- length = props ? props.length : 0,
- valsLength = values ? values.length : 0,
- result = {};
+ return baseZipObject(props || [], values || [], assignValue);
+ }
- while (++index < length) {
- baseSet(result, props[index], index < valsLength ? values[index] : undefined);
- }
- return result;
+ /**
+ * This method is like `_.zipObject` except that it supports property paths.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} [props=[]] The property names.
+ * @param {Array} [values=[]] The property values.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
+ * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
+ */
+ function zipObjectDeep(props, values) {
+ return baseZipObject(props || [], values || [], baseSet);
}
/**
@@ -7648,17 +7748,17 @@
* @returns {Object} Returns the composed aggregate object.
* @example
*
- * var keyData = [
+ * var array = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
- * _.keyBy(keyData, function(o) {
+ * _.keyBy(array, function(o) {
* return String.fromCharCode(o.code);
* });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
- * _.keyBy(keyData, 'dir');
+ * _.keyBy(array, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*/
var keyBy = createAggregator(function(result, value, key) {
@@ -7817,7 +7917,7 @@
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
- * });
+ * }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
@@ -9455,9 +9555,16 @@
* // => false
*/
function isEmpty(value) {
- return (!isObjectLike(value) || isFunction(value.splice))
- ? !size(value)
- : !keys(value).length;
+ if (isArrayLike(value) &&
+ (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) {
+ return !value.length;
+ }
+ for (var key in value) {
+ if (hasOwnProperty.call(value, key)) {
+ return false;
+ }
+ }
+ return true;
}
/**
@@ -9682,8 +9789,6 @@
* // => false
*/
function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
@@ -10929,14 +11034,12 @@
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite property
- * assignments of previous values unless `multiVal` is `true`.
+ * assignments of previous values.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to invert.
- * @param {boolean} [multiVal] Allow multiple values per key.
- * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
* @returns {Object} Returns the new inverted object.
* @example
*
@@ -10944,27 +11047,43 @@
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
- *
- * // with `multiVal`
- * _.invert(object, true);
- * // => { '1': ['a', 'c'], '2': ['b'] }
*/
- function invert(object, multiVal, guard) {
- return arrayReduce(keys(object), function(result, key) {
- var value = object[key];
- if (multiVal && !guard) {
- if (hasOwnProperty.call(result, value)) {
- result[value].push(key);
- } else {
- result[value] = [key];
- }
- }
- else {
- result[value] = key;
- }
- return result;
- }, {});
- }
+ var invert = createInverter(function(result, value, key) {
+ result[value] = key;
+ }, constant(identity));
+
+ /**
+ * This method is like `_.invert` except that the inverted object is generated
+ * from the results of running each element of `object` through `iteratee`.
+ * The corresponding inverted value of each inverted key is an array of keys
+ * responsible for generating the inverted value. The iteratee is invoked
+ * with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to invert.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Object} Returns the new inverted object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2, 'c': 1 };
+ *
+ * _.invertBy(object);
+ * // => { '1': ['a', 'c'], '2': ['b'] }
+ *
+ * _.invertBy(object, function(value) {
+ * return 'group' + value;
+ * });
+ * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
+ */
+ var invertBy = createInverter(function(result, value, key) {
+ if (hasOwnProperty.call(result, value)) {
+ result[value].push(key);
+ } else {
+ result[value] = [key];
+ }
+ }, getIteratee);
/**
* Invokes the method at `path` of `object`.
@@ -11465,12 +11584,12 @@
* _.transform([2, 3, 4], function(result, n) {
* result.push(n *= n);
* return n % 2 == 0;
- * });
+ * }, []);
* // => [4, 9]
*
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
- * });
+ * }, {});
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function transform(object, iteratee, accumulator) {
@@ -13808,7 +13927,7 @@
function sum(array) {
return (array && array.length)
? baseSum(array, identity)
- : undefined;
+ : 0;
}
/**
@@ -13836,7 +13955,7 @@
function sumBy(array, iteratee) {
return (array && array.length)
? baseSum(array, getIteratee(iteratee))
- : undefined;
+ : 0;
}
/*------------------------------------------------------------------------*/
@@ -13925,6 +14044,7 @@
lodash.intersectionBy = intersectionBy;
lodash.intersectionWith = intersectionWith;
lodash.invert = invert;
+ lodash.invertBy = invertBy;
lodash.invokeMap = invokeMap;
lodash.iteratee = iteratee;
lodash.keyBy = keyBy;
@@ -14013,6 +14133,7 @@
lodash.xorWith = xorWith;
lodash.zip = zip;
lodash.zipObject = zipObject;
+ lodash.zipObjectDeep = zipObjectDeep;
lodash.zipWith = zipWith;
// Add aliases.
diff --git a/map.js b/map.js
index 494193f52..78e47bd76 100644
--- a/map.js
+++ b/map.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayMap', './internal/baseIteratee', './internal/baseMap', './isArray'], function(arrayMap, baseIteratee, baseMap, isArray) {
+define(['./_arrayMap', './_baseIteratee', './_baseMap', './isArray'], function(arrayMap, baseIteratee, baseMap, isArray) {
/**
* Creates an array of values by running each element in `collection` through
diff --git a/mapKeys.js b/mapKeys.js
index 9b3a85bbb..3b8c589c8 100644
--- a/mapKeys.js
+++ b/mapKeys.js
@@ -1,4 +1,4 @@
-define(['./internal/baseForOwn', './internal/baseIteratee'], function(baseForOwn, baseIteratee) {
+define(['./_baseForOwn', './_baseIteratee'], function(baseForOwn, baseIteratee) {
/**
* The opposite of `_.mapValues`; this method creates an object with the
diff --git a/mapValues.js b/mapValues.js
index 253b76f63..c1dc210ee 100644
--- a/mapValues.js
+++ b/mapValues.js
@@ -1,4 +1,4 @@
-define(['./internal/baseForOwn', './internal/baseIteratee'], function(baseForOwn, baseIteratee) {
+define(['./_baseForOwn', './_baseIteratee'], function(baseForOwn, baseIteratee) {
/**
* Creates an object with the same keys as `object` and values generated by
diff --git a/matches.js b/matches.js
index dae86a90f..99398eac0 100644
--- a/matches.js
+++ b/matches.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClone', './internal/baseMatches'], function(baseClone, baseMatches) {
+define(['./_baseClone', './_baseMatches'], function(baseClone, baseMatches) {
/**
* Creates a function that performs a deep partial comparison between a given
diff --git a/matchesProperty.js b/matchesProperty.js
index 3fda9b03b..f47f71e1b 100644
--- a/matchesProperty.js
+++ b/matchesProperty.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClone', './internal/baseMatchesProperty'], function(baseClone, baseMatchesProperty) {
+define(['./_baseClone', './_baseMatchesProperty'], function(baseClone, baseMatchesProperty) {
/**
* Creates a function that performs a deep partial comparison between the
diff --git a/max.js b/max.js
index 3ef829779..ce11d1674 100644
--- a/max.js
+++ b/max.js
@@ -1,4 +1,4 @@
-define(['./internal/baseExtremum', './gt', './identity'], function(baseExtremum, gt, identity) {
+define(['./_baseExtremum', './gt', './identity'], function(baseExtremum, gt, identity) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/maxBy.js b/maxBy.js
index 1f2d4b113..95e9cb530 100644
--- a/maxBy.js
+++ b/maxBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseExtremum', './internal/baseIteratee', './gt'], function(baseExtremum, baseIteratee, gt) {
+define(['./_baseExtremum', './_baseIteratee', './gt'], function(baseExtremum, baseIteratee, gt) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/memoize.js b/memoize.js
index b82c6e01f..81dc6e32f 100644
--- a/memoize.js
+++ b/memoize.js
@@ -1,4 +1,4 @@
-define(['./internal/MapCache'], function(MapCache) {
+define(['./_MapCache'], function(MapCache) {
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
diff --git a/merge.js b/merge.js
index 35b02d762..9e33901d8 100644
--- a/merge.js
+++ b/merge.js
@@ -1,4 +1,4 @@
-define(['./internal/baseMerge', './internal/createAssigner'], function(baseMerge, createAssigner) {
+define(['./_baseMerge', './_createAssigner'], function(baseMerge, createAssigner) {
/**
* Recursively merges own and inherited enumerable properties of source
diff --git a/mergeWith.js b/mergeWith.js
index 792236a77..b6bd13bf6 100644
--- a/mergeWith.js
+++ b/mergeWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseMerge', './internal/createAssigner'], function(baseMerge, createAssigner) {
+define(['./_baseMerge', './_createAssigner'], function(baseMerge, createAssigner) {
/**
* This method is like `_.merge` except that it accepts `customizer` which
diff --git a/method.js b/method.js
index edefb141c..b7403fd15 100644
--- a/method.js
+++ b/method.js
@@ -1,4 +1,4 @@
-define(['./internal/baseInvoke', './rest'], function(baseInvoke, rest) {
+define(['./_baseInvoke', './rest'], function(baseInvoke, rest) {
/**
* Creates a function that invokes the method at `path` of a given object.
diff --git a/methodOf.js b/methodOf.js
index 5374374cf..3a6996105 100644
--- a/methodOf.js
+++ b/methodOf.js
@@ -1,4 +1,4 @@
-define(['./internal/baseInvoke', './rest'], function(baseInvoke, rest) {
+define(['./_baseInvoke', './rest'], function(baseInvoke, rest) {
/**
* The opposite of `_.method`; this method creates a function that invokes
diff --git a/min.js b/min.js
index f53590db6..49a64e25d 100644
--- a/min.js
+++ b/min.js
@@ -1,4 +1,4 @@
-define(['./internal/baseExtremum', './identity', './lt'], function(baseExtremum, identity, lt) {
+define(['./_baseExtremum', './identity', './lt'], function(baseExtremum, identity, lt) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/minBy.js b/minBy.js
index 11e0aed5f..7438531b5 100644
--- a/minBy.js
+++ b/minBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseExtremum', './internal/baseIteratee', './lt'], function(baseExtremum, baseIteratee, lt) {
+define(['./_baseExtremum', './_baseIteratee', './lt'], function(baseExtremum, baseIteratee, lt) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/mixin.js b/mixin.js
index 291e5c805..f8e972ca6 100644
--- a/mixin.js
+++ b/mixin.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayEach', './internal/arrayPush', './internal/baseFunctions', './internal/copyArray', './isFunction', './isObject', './keys'], function(arrayEach, arrayPush, baseFunctions, copyArray, isFunction, isObject, keys) {
+define(['./_arrayEach', './_arrayPush', './_baseFunctions', './_copyArray', './isFunction', './isObject', './keys'], function(arrayEach, arrayPush, baseFunctions, copyArray, isFunction, isObject, keys) {
/**
* Adds all own enumerable function properties of a source object to the
diff --git a/object.js b/object.js
index 18aeb1459..913f1a5dc 100644
--- a/object.js
+++ b/object.js
@@ -1,4 +1,4 @@
-define(['./assign', './assignIn', './assignInWith', './assignWith', './create', './defaults', './defaultsDeep', './extend', './extendWith', './findKey', './findLastKey', './forIn', './forInRight', './forOwn', './forOwnRight', './functions', './functionsIn', './get', './has', './hasIn', './invert', './invoke', './keys', './keysIn', './mapKeys', './mapValues', './merge', './mergeWith', './omit', './omitBy', './pick', './pickBy', './result', './set', './setWith', './toPairs', './toPairsIn', './transform', './unset', './values', './valuesIn'], function(assign, assignIn, assignInWith, assignWith, create, defaults, defaultsDeep, extend, extendWith, findKey, findLastKey, forIn, forInRight, forOwn, forOwnRight, functions, functionsIn, get, has, hasIn, invert, invoke, keys, keysIn, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, result, set, setWith, toPairs, toPairsIn, transform, unset, values, valuesIn) {
+define(['./assign', './assignIn', './assignInWith', './assignWith', './create', './defaults', './defaultsDeep', './extend', './extendWith', './findKey', './findLastKey', './forIn', './forInRight', './forOwn', './forOwnRight', './functions', './functionsIn', './get', './has', './hasIn', './invert', './invertBy', './invoke', './keys', './keysIn', './mapKeys', './mapValues', './merge', './mergeWith', './omit', './omitBy', './pick', './pickBy', './result', './set', './setWith', './toPairs', './toPairsIn', './transform', './unset', './values', './valuesIn'], function(assign, assignIn, assignInWith, assignWith, create, defaults, defaultsDeep, extend, extendWith, findKey, findLastKey, forIn, forInRight, forOwn, forOwnRight, functions, functionsIn, get, has, hasIn, invert, invertBy, invoke, keys, keysIn, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, result, set, setWith, toPairs, toPairsIn, transform, unset, values, valuesIn) {
return {
'assign': assign,
'assignIn': assignIn,
@@ -21,6 +21,7 @@ define(['./assign', './assignIn', './assignInWith', './assignWith', './create',
'has': has,
'hasIn': hasIn,
'invert': invert,
+ 'invertBy': invertBy,
'invoke': invoke,
'keys': keys,
'keysIn': keysIn,
diff --git a/omit.js b/omit.js
index 88bd2502d..e4e9978c9 100644
--- a/omit.js
+++ b/omit.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayMap', './internal/baseDifference', './internal/baseFlatten', './internal/basePick', './keysIn', './rest'], function(arrayMap, baseDifference, baseFlatten, basePick, keysIn, rest) {
+define(['./_arrayMap', './_baseDifference', './_baseFlatten', './_basePick', './keysIn', './rest'], function(arrayMap, baseDifference, baseFlatten, basePick, keysIn, rest) {
/**
* The opposite of `_.pick`; this method creates an object composed of the
diff --git a/omitBy.js b/omitBy.js
index 2e5ca2f59..9261d5e04 100644
--- a/omitBy.js
+++ b/omitBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/basePickBy'], function(baseIteratee, basePickBy) {
+define(['./_baseIteratee', './_basePickBy'], function(baseIteratee, basePickBy) {
/**
* The opposite of `_.pickBy`; this method creates an object composed of the
diff --git a/orderBy.js b/orderBy.js
index b3a2d5b0c..60786b4a0 100644
--- a/orderBy.js
+++ b/orderBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseOrderBy', './isArray'], function(baseOrderBy, isArray) {
+define(['./_baseOrderBy', './isArray'], function(baseOrderBy, isArray) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/over.js b/over.js
index 9c8a1e29c..c3ca7f249 100644
--- a/over.js
+++ b/over.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayMap', './internal/createOver'], function(arrayMap, createOver) {
+define(['./_arrayMap', './_createOver'], function(arrayMap, createOver) {
/**
* Creates a function that invokes `iteratees` with the arguments provided
diff --git a/overArgs.js b/overArgs.js
index 84d43b3ed..025145560 100644
--- a/overArgs.js
+++ b/overArgs.js
@@ -1,4 +1,4 @@
-define(['./internal/apply', './internal/arrayMap', './internal/baseFlatten', './internal/baseIteratee', './rest'], function(apply, arrayMap, baseFlatten, baseIteratee, rest) {
+define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './rest'], function(apply, arrayMap, baseFlatten, baseIteratee, rest) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
diff --git a/overEvery.js b/overEvery.js
index da5f2fa2e..810468274 100644
--- a/overEvery.js
+++ b/overEvery.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayEvery', './internal/createOver'], function(arrayEvery, createOver) {
+define(['./_arrayEvery', './_createOver'], function(arrayEvery, createOver) {
/**
* Creates a function that checks if **all** of the `predicates` return
diff --git a/overSome.js b/overSome.js
index 54391de6d..04421cdd7 100644
--- a/overSome.js
+++ b/overSome.js
@@ -1,4 +1,4 @@
-define(['./internal/arraySome', './internal/createOver'], function(arraySome, createOver) {
+define(['./_arraySome', './_createOver'], function(arraySome, createOver) {
/**
* Creates a function that checks if **any** of the `predicates` return
diff --git a/package.json b/package.json
index ab391f4b5..7fc9b6705 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "lodash-amd",
- "version": "4.0.1",
+ "version": "4.1.0",
"description": "Lodash exported as AMD modules.",
"homepage": "https://lodash.com/custom-builds",
"license": "MIT",
diff --git a/pad.js b/pad.js
index 9fa5b7ed8..cd98c62ab 100644
--- a/pad.js
+++ b/pad.js
@@ -1,4 +1,4 @@
-define(['./internal/createPadding', './internal/stringSize', './toInteger', './toString'], function(createPadding, stringSize, toInteger, toString) {
+define(['./_createPadding', './_stringSize', './toInteger', './toString'], function(createPadding, stringSize, toInteger, toString) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
diff --git a/padEnd.js b/padEnd.js
index f901462dd..993e2e426 100644
--- a/padEnd.js
+++ b/padEnd.js
@@ -1,4 +1,4 @@
-define(['./internal/createPadding', './toString'], function(createPadding, toString) {
+define(['./_createPadding', './toString'], function(createPadding, toString) {
/**
* Pads `string` on the right side if it's shorter than `length`. Padding
diff --git a/padStart.js b/padStart.js
index d3ff5f8c7..2dd041356 100644
--- a/padStart.js
+++ b/padStart.js
@@ -1,4 +1,4 @@
-define(['./internal/createPadding', './toString'], function(createPadding, toString) {
+define(['./_createPadding', './toString'], function(createPadding, toString) {
/**
* Pads `string` on the left side if it's shorter than `length`. Padding
diff --git a/parseInt.js b/parseInt.js
index 7e6e129b2..615a7afb8 100644
--- a/parseInt.js
+++ b/parseInt.js
@@ -1,4 +1,4 @@
-define(['./internal/root', './toString'], function(root, toString) {
+define(['./_root', './toString'], function(root, toString) {
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
diff --git a/partial.js b/partial.js
index f99cc68d4..ebb467fca 100644
--- a/partial.js
+++ b/partial.js
@@ -1,4 +1,4 @@
-define(['./internal/createWrapper', './internal/replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
+define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/partialRight.js b/partialRight.js
index 4104256dc..a05951b96 100644
--- a/partialRight.js
+++ b/partialRight.js
@@ -1,4 +1,4 @@
-define(['./internal/createWrapper', './internal/replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
+define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/partition.js b/partition.js
index 79cdacd05..ce154a3d9 100644
--- a/partition.js
+++ b/partition.js
@@ -1,4 +1,4 @@
-define(['./internal/createAggregator'], function(createAggregator) {
+define(['./_createAggregator'], function(createAggregator) {
/**
* Creates an array of elements split into two groups, the first of which
diff --git a/pick.js b/pick.js
index d938ccd6f..b22384daf 100644
--- a/pick.js
+++ b/pick.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFlatten', './internal/basePick', './rest'], function(baseFlatten, basePick, rest) {
+define(['./_baseFlatten', './_basePick', './rest'], function(baseFlatten, basePick, rest) {
/**
* Creates an object composed of the picked `object` properties.
diff --git a/pickBy.js b/pickBy.js
index 0f02d6012..48b114f9a 100644
--- a/pickBy.js
+++ b/pickBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/basePickBy'], function(baseIteratee, basePickBy) {
+define(['./_baseIteratee', './_basePickBy'], function(baseIteratee, basePickBy) {
/**
* Creates an object composed of the `object` properties `predicate` returns
diff --git a/plant.js b/plant.js
index 39143bf7d..af5a1932b 100644
--- a/plant.js
+++ b/plant.js
@@ -1,4 +1,4 @@
-define(['./internal/baseLodash', './internal/wrapperClone'], function(baseLodash, wrapperClone) {
+define(['./_baseLodash', './_wrapperClone'], function(baseLodash, wrapperClone) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/property.js b/property.js
index 9f5059508..ad60026ed 100644
--- a/property.js
+++ b/property.js
@@ -1,4 +1,4 @@
-define(['./internal/baseProperty', './internal/basePropertyDeep', './internal/isKey'], function(baseProperty, basePropertyDeep, isKey) {
+define(['./_baseProperty', './_basePropertyDeep', './_isKey'], function(baseProperty, basePropertyDeep, isKey) {
/**
* Creates a function that returns the value at `path` of a given object.
diff --git a/propertyOf.js b/propertyOf.js
index 427767cfc..7b9246880 100644
--- a/propertyOf.js
+++ b/propertyOf.js
@@ -1,4 +1,4 @@
-define(['./internal/baseGet'], function(baseGet) {
+define(['./_baseGet'], function(baseGet) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/pullAll.js b/pullAll.js
index 70b7ef419..cc62ebc3b 100644
--- a/pullAll.js
+++ b/pullAll.js
@@ -1,4 +1,4 @@
-define(['./internal/basePullAll'], function(basePullAll) {
+define(['./_basePullAll'], function(basePullAll) {
/**
* This method is like `_.pull` except that it accepts an array of values to remove.
diff --git a/pullAllBy.js b/pullAllBy.js
index f93b50812..84b469f28 100644
--- a/pullAllBy.js
+++ b/pullAllBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/basePullAllBy'], function(baseIteratee, basePullAllBy) {
+define(['./_baseIteratee', './_basePullAllBy'], function(baseIteratee, basePullAllBy) {
/**
* This method is like `_.pullAll` except that it accepts `iteratee` which is
diff --git a/pullAt.js b/pullAt.js
index 438a2efef..a04bfe5fa 100644
--- a/pullAt.js
+++ b/pullAt.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayMap', './internal/baseAt', './internal/baseFlatten', './internal/basePullAt', './internal/compareAscending', './rest'], function(arrayMap, baseAt, baseFlatten, basePullAt, compareAscending, rest) {
+define(['./_arrayMap', './_baseAt', './_baseFlatten', './_basePullAt', './_compareAscending', './rest'], function(arrayMap, baseAt, baseFlatten, basePullAt, compareAscending, rest) {
/**
* Removes elements from `array` corresponding to `indexes` and returns an
diff --git a/random.js b/random.js
index 23106a732..35f065cfc 100644
--- a/random.js
+++ b/random.js
@@ -1,4 +1,4 @@
-define(['./internal/baseRandom', './internal/isIterateeCall', './toNumber'], function(baseRandom, isIterateeCall, toNumber) {
+define(['./_baseRandom', './_isIterateeCall', './toNumber'], function(baseRandom, isIterateeCall, toNumber) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/range.js b/range.js
index fcdf8d5f9..1f9f13008 100644
--- a/range.js
+++ b/range.js
@@ -1,4 +1,4 @@
-define(['./internal/createRange'], function(createRange) {
+define(['./_createRange'], function(createRange) {
/**
* Creates an array of numbers (positive and/or negative) progressing from
diff --git a/rangeRight.js b/rangeRight.js
index 8a2f997e6..78c6d77fd 100644
--- a/rangeRight.js
+++ b/rangeRight.js
@@ -1,4 +1,4 @@
-define(['./internal/createRange'], function(createRange) {
+define(['./_createRange'], function(createRange) {
/**
* This method is like `_.range` except that it populates values in
diff --git a/rearg.js b/rearg.js
index 095cf347b..15b7a16d3 100644
--- a/rearg.js
+++ b/rearg.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFlatten', './internal/createWrapper', './rest'], function(baseFlatten, createWrapper, rest) {
+define(['./_baseFlatten', './_createWrapper', './rest'], function(baseFlatten, createWrapper, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/reduce.js b/reduce.js
index f3c2d822b..46ed1fa71 100644
--- a/reduce.js
+++ b/reduce.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayReduce', './internal/baseEach', './internal/baseIteratee', './internal/baseReduce', './isArray'], function(arrayReduce, baseEach, baseIteratee, baseReduce, isArray) {
+define(['./_arrayReduce', './_baseEach', './_baseIteratee', './_baseReduce', './isArray'], function(arrayReduce, baseEach, baseIteratee, baseReduce, isArray) {
/**
* Reduces `collection` to a value which is the accumulated result of running
@@ -26,7 +26,7 @@ define(['./internal/arrayReduce', './internal/baseEach', './internal/baseIterate
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
- * });
+ * }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
diff --git a/reduceRight.js b/reduceRight.js
index 98dbe2886..ce8a230f6 100644
--- a/reduceRight.js
+++ b/reduceRight.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayReduceRight', './internal/baseEachRight', './internal/baseIteratee', './internal/baseReduce', './isArray'], function(arrayReduceRight, baseEachRight, baseIteratee, baseReduce, isArray) {
+define(['./_arrayReduceRight', './_baseEachRight', './_baseIteratee', './_baseReduce', './isArray'], function(arrayReduceRight, baseEachRight, baseIteratee, baseReduce, isArray) {
/**
* This method is like `_.reduce` except that it iterates over elements of
diff --git a/reject.js b/reject.js
index c73cea099..9540faf8e 100644
--- a/reject.js
+++ b/reject.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayFilter', './internal/baseFilter', './internal/baseIteratee', './isArray'], function(arrayFilter, baseFilter, baseIteratee, isArray) {
+define(['./_arrayFilter', './_baseFilter', './_baseIteratee', './isArray'], function(arrayFilter, baseFilter, baseIteratee, isArray) {
/**
* The opposite of `_.filter`; this method returns the elements of `collection`
diff --git a/remove.js b/remove.js
index 71d0d725b..cc6eebee1 100644
--- a/remove.js
+++ b/remove.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/basePullAt'], function(baseIteratee, basePullAt) {
+define(['./_baseIteratee', './_basePullAt'], function(baseIteratee, basePullAt) {
/**
* Removes all elements from `array` that `predicate` returns truthy for
diff --git a/rest.js b/rest.js
index ddfd68e42..24b851b03 100644
--- a/rest.js
+++ b/rest.js
@@ -1,4 +1,4 @@
-define(['./internal/apply', './toInteger'], function(apply, toInteger) {
+define(['./_apply', './toInteger'], function(apply, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/result.js b/result.js
index 78538688e..33fb2eec1 100644
--- a/result.js
+++ b/result.js
@@ -1,4 +1,4 @@
-define(['./internal/baseToPath', './get', './isFunction', './internal/isKey', './internal/parent'], function(baseToPath, get, isFunction, isKey, parent) {
+define(['./_baseToPath', './get', './isFunction', './_isKey', './_parent'], function(baseToPath, get, isFunction, isKey, parent) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/round.js b/round.js
index a26fb48e3..ecd3e47e9 100644
--- a/round.js
+++ b/round.js
@@ -1,4 +1,4 @@
-define(['./internal/createRound'], function(createRound) {
+define(['./_createRound'], function(createRound) {
/**
* Computes `number` rounded to `precision`.
diff --git a/sample.js b/sample.js
index e60de5dc9..91538735e 100644
--- a/sample.js
+++ b/sample.js
@@ -1,4 +1,4 @@
-define(['./internal/baseRandom', './isArrayLike', './values'], function(baseRandom, isArrayLike, values) {
+define(['./_baseRandom', './isArrayLike', './values'], function(baseRandom, isArrayLike, values) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/sampleSize.js b/sampleSize.js
index 55e96e5be..c7d36d5a2 100644
--- a/sampleSize.js
+++ b/sampleSize.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClamp', './internal/baseRandom', './toArray', './toInteger'], function(baseClamp, baseRandom, toArray, toInteger) {
+define(['./_baseClamp', './_baseRandom', './toArray', './toInteger'], function(baseClamp, baseRandom, toArray, toInteger) {
/**
* Gets `n` random elements at unique keys from `collection` up to the
diff --git a/set.js b/set.js
index e50389959..5f4fbc04c 100644
--- a/set.js
+++ b/set.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSet'], function(baseSet) {
+define(['./_baseSet'], function(baseSet) {
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist
diff --git a/setWith.js b/setWith.js
index 2bc472acf..b51cfc2f8 100644
--- a/setWith.js
+++ b/setWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSet'], function(baseSet) {
+define(['./_baseSet'], function(baseSet) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/size.js b/size.js
index f5dc24fff..a7cd25178 100644
--- a/size.js
+++ b/size.js
@@ -1,4 +1,4 @@
-define(['./isArrayLike', './isString', './keys', './internal/stringSize'], function(isArrayLike, isString, keys, stringSize) {
+define(['./isArrayLike', './isString', './keys', './_stringSize'], function(isArrayLike, isString, keys, stringSize) {
/**
* Gets the size of `collection` by returning its length for array-like
diff --git a/slice.js b/slice.js
index 520fd0cf5..9dbb5b11a 100644
--- a/slice.js
+++ b/slice.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSlice', './internal/isIterateeCall', './toInteger'], function(baseSlice, isIterateeCall, toInteger) {
+define(['./_baseSlice', './_isIterateeCall', './toInteger'], function(baseSlice, isIterateeCall, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/snakeCase.js b/snakeCase.js
index cd4ecdc8b..2dab89cac 100644
--- a/snakeCase.js
+++ b/snakeCase.js
@@ -1,4 +1,4 @@
-define(['./internal/createCompounder'], function(createCompounder) {
+define(['./_createCompounder'], function(createCompounder) {
/**
* Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
diff --git a/some.js b/some.js
index 44d8ed261..61642b153 100644
--- a/some.js
+++ b/some.js
@@ -1,4 +1,4 @@
-define(['./internal/arraySome', './internal/baseIteratee', './internal/baseSome', './isArray', './internal/isIterateeCall'], function(arraySome, baseIteratee, baseSome, isArray, isIterateeCall) {
+define(['./_arraySome', './_baseIteratee', './_baseSome', './isArray', './_isIterateeCall'], function(arraySome, baseIteratee, baseSome, isArray, isIterateeCall) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/sortBy.js b/sortBy.js
index 62e1c1919..bd85cc563 100644
--- a/sortBy.js
+++ b/sortBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFlatten', './internal/baseOrderBy', './internal/isIterateeCall', './rest'], function(baseFlatten, baseOrderBy, isIterateeCall, rest) {
+define(['./_baseFlatten', './_baseOrderBy', './_isIterateeCall', './rest'], function(baseFlatten, baseOrderBy, isIterateeCall, rest) {
/**
* Creates an array of elements, sorted in ascending order by the results of
diff --git a/sortedIndex.js b/sortedIndex.js
index c0784bb10..a5e828ce8 100644
--- a/sortedIndex.js
+++ b/sortedIndex.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSortedIndex'], function(baseSortedIndex) {
+define(['./_baseSortedIndex'], function(baseSortedIndex) {
/**
* Uses a binary search to determine the lowest index at which `value` should
diff --git a/sortedIndexBy.js b/sortedIndexBy.js
index 1563b1a89..b459ba3c3 100644
--- a/sortedIndexBy.js
+++ b/sortedIndexBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/baseSortedIndexBy'], function(baseIteratee, baseSortedIndexBy) {
+define(['./_baseIteratee', './_baseSortedIndexBy'], function(baseIteratee, baseSortedIndexBy) {
/**
* This method is like `_.sortedIndex` except that it accepts `iteratee`
diff --git a/sortedIndexOf.js b/sortedIndexOf.js
index ca4c6e66f..e09f57dfb 100644
--- a/sortedIndexOf.js
+++ b/sortedIndexOf.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSortedIndex', './eq'], function(baseSortedIndex, eq) {
+define(['./_baseSortedIndex', './eq'], function(baseSortedIndex, eq) {
/**
* This method is like `_.indexOf` except that it performs a binary
diff --git a/sortedLastIndex.js b/sortedLastIndex.js
index 42193f8f7..3abde99da 100644
--- a/sortedLastIndex.js
+++ b/sortedLastIndex.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSortedIndex'], function(baseSortedIndex) {
+define(['./_baseSortedIndex'], function(baseSortedIndex) {
/**
* This method is like `_.sortedIndex` except that it returns the highest
diff --git a/sortedLastIndexBy.js b/sortedLastIndexBy.js
index aaa542f42..a23c43f74 100644
--- a/sortedLastIndexBy.js
+++ b/sortedLastIndexBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/baseSortedIndexBy'], function(baseIteratee, baseSortedIndexBy) {
+define(['./_baseIteratee', './_baseSortedIndexBy'], function(baseIteratee, baseSortedIndexBy) {
/**
* This method is like `_.sortedLastIndex` except that it accepts `iteratee`
diff --git a/sortedLastIndexOf.js b/sortedLastIndexOf.js
index 13569c073..bd3c33fd2 100644
--- a/sortedLastIndexOf.js
+++ b/sortedLastIndexOf.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSortedIndex', './eq'], function(baseSortedIndex, eq) {
+define(['./_baseSortedIndex', './eq'], function(baseSortedIndex, eq) {
/**
* This method is like `_.lastIndexOf` except that it performs a binary
diff --git a/sortedUniq.js b/sortedUniq.js
index f92c43f90..6ed493ff4 100644
--- a/sortedUniq.js
+++ b/sortedUniq.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSortedUniq'], function(baseSortedUniq) {
+define(['./_baseSortedUniq'], function(baseSortedUniq) {
/**
* This method is like `_.uniq` except that it's designed and optimized
diff --git a/sortedUniqBy.js b/sortedUniqBy.js
index dac84c8ab..d7c062835 100644
--- a/sortedUniqBy.js
+++ b/sortedUniqBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/baseSortedUniqBy'], function(baseIteratee, baseSortedUniqBy) {
+define(['./_baseIteratee', './_baseSortedUniqBy'], function(baseIteratee, baseSortedUniqBy) {
/**
* This method is like `_.uniqBy` except that it's designed and optimized
diff --git a/spread.js b/spread.js
index a92993066..10ca9d2c5 100644
--- a/spread.js
+++ b/spread.js
@@ -1,4 +1,4 @@
-define(['./internal/apply'], function(apply) {
+define(['./_apply'], function(apply) {
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
diff --git a/startCase.js b/startCase.js
index 9b5275d7b..69cf85edd 100644
--- a/startCase.js
+++ b/startCase.js
@@ -1,4 +1,4 @@
-define(['./capitalize', './internal/createCompounder'], function(capitalize, createCompounder) {
+define(['./capitalize', './_createCompounder'], function(capitalize, createCompounder) {
/**
* Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
diff --git a/startsWith.js b/startsWith.js
index 2ce0c15f8..61248c6f6 100644
--- a/startsWith.js
+++ b/startsWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClamp', './toInteger', './toString'], function(baseClamp, toInteger, toString) {
+define(['./_baseClamp', './toInteger', './toString'], function(baseClamp, toInteger, toString) {
/**
* Checks if `string` starts with the given target string.
diff --git a/sum.js b/sum.js
index 13ea9cacc..1a46aaf23 100644
--- a/sum.js
+++ b/sum.js
@@ -1,7 +1,4 @@
-define(['./internal/baseSum', './identity'], function(baseSum, identity) {
-
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
- var undefined;
+define(['./_baseSum', './identity'], function(baseSum, identity) {
/**
* Computes the sum of the values in `array`.
@@ -19,7 +16,7 @@ define(['./internal/baseSum', './identity'], function(baseSum, identity) {
function sum(array) {
return (array && array.length)
? baseSum(array, identity)
- : undefined;
+ : 0;
}
return sum;
diff --git a/sumBy.js b/sumBy.js
index d4cda5d55..cadd17f03 100644
--- a/sumBy.js
+++ b/sumBy.js
@@ -1,7 +1,4 @@
-define(['./internal/baseIteratee', './internal/baseSum'], function(baseIteratee, baseSum) {
-
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
- var undefined;
+define(['./_baseIteratee', './_baseSum'], function(baseIteratee, baseSum) {
/**
* This method is like `_.sum` except that it accepts `iteratee` which is
@@ -28,7 +25,7 @@ define(['./internal/baseIteratee', './internal/baseSum'], function(baseIteratee,
function sumBy(array, iteratee) {
return (array && array.length)
? baseSum(array, baseIteratee(iteratee))
- : undefined;
+ : 0;
}
return sumBy;
diff --git a/take.js b/take.js
index 9cbb323ef..9056d1921 100644
--- a/take.js
+++ b/take.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSlice', './toInteger'], function(baseSlice, toInteger) {
+define(['./_baseSlice', './toInteger'], function(baseSlice, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/takeRight.js b/takeRight.js
index cd5da5e9a..86a6955d5 100644
--- a/takeRight.js
+++ b/takeRight.js
@@ -1,4 +1,4 @@
-define(['./internal/baseSlice', './toInteger'], function(baseSlice, toInteger) {
+define(['./_baseSlice', './toInteger'], function(baseSlice, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/takeRightWhile.js b/takeRightWhile.js
index 7422bfbb2..a0e5c54bf 100644
--- a/takeRightWhile.js
+++ b/takeRightWhile.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/baseWhile'], function(baseIteratee, baseWhile) {
+define(['./_baseIteratee', './_baseWhile'], function(baseIteratee, baseWhile) {
/**
* Creates a slice of `array` with elements taken from the end. Elements are
diff --git a/takeWhile.js b/takeWhile.js
index d6fa143ac..d47e5c1d3 100644
--- a/takeWhile.js
+++ b/takeWhile.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/baseWhile'], function(baseIteratee, baseWhile) {
+define(['./_baseIteratee', './_baseWhile'], function(baseIteratee, baseWhile) {
/**
* Creates a slice of `array` with elements taken from the beginning. Elements
diff --git a/template.js b/template.js
index e99aa59a5..35ed4701a 100644
--- a/template.js
+++ b/template.js
@@ -1,4 +1,4 @@
-define(['./internal/assignInDefaults', './assignInWith', './attempt', './internal/baseValues', './internal/escapeStringChar', './isError', './internal/isIterateeCall', './keys', './internal/reInterpolate', './templateSettings', './toString'], function(assignInDefaults, assignInWith, attempt, baseValues, escapeStringChar, isError, isIterateeCall, keys, reInterpolate, templateSettings, toString) {
+define(['./_assignInDefaults', './assignInWith', './attempt', './_baseValues', './_escapeStringChar', './isError', './_isIterateeCall', './keys', './_reInterpolate', './templateSettings', './toString'], function(assignInDefaults, assignInWith, attempt, baseValues, escapeStringChar, isError, isIterateeCall, keys, reInterpolate, templateSettings, toString) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/templateSettings.js b/templateSettings.js
index 4fdbf50d3..1cf7abe9c 100644
--- a/templateSettings.js
+++ b/templateSettings.js
@@ -1,4 +1,4 @@
-define(['./escape', './internal/reEscape', './internal/reEvaluate', './internal/reInterpolate'], function(escape, reEscape, reEvaluate, reInterpolate) {
+define(['./escape', './_reEscape', './_reEvaluate', './_reInterpolate'], function(escape, reEscape, reEvaluate, reInterpolate) {
/**
* By default, the template delimiters used by lodash are like those in
diff --git a/times.js b/times.js
index f095012f5..b7959e9bd 100644
--- a/times.js
+++ b/times.js
@@ -1,4 +1,4 @@
-define(['./internal/baseTimes', './internal/toFunction', './toInteger'], function(baseTimes, toFunction, toInteger) {
+define(['./_baseTimes', './_toFunction', './toInteger'], function(baseTimes, toFunction, toInteger) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
diff --git a/toArray.js b/toArray.js
index 042d3256b..9c97dc7d4 100644
--- a/toArray.js
+++ b/toArray.js
@@ -1,4 +1,4 @@
-define(['./internal/Symbol', './internal/copyArray', './internal/getTag', './isArrayLike', './isString', './internal/iteratorToArray', './internal/mapToArray', './internal/setToArray', './internal/stringToArray', './values'], function(Symbol, copyArray, getTag, isArrayLike, isString, iteratorToArray, mapToArray, setToArray, stringToArray, values) {
+define(['./_Symbol', './_copyArray', './_getTag', './isArrayLike', './isString', './_iteratorToArray', './_mapToArray', './_setToArray', './_stringToArray', './values'], function(Symbol, copyArray, getTag, isArrayLike, isString, iteratorToArray, mapToArray, setToArray, stringToArray, values) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/toLength.js b/toLength.js
index fd102c580..81748adfe 100644
--- a/toLength.js
+++ b/toLength.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClamp', './toInteger'], function(baseClamp, toInteger) {
+define(['./_baseClamp', './toInteger'], function(baseClamp, toInteger) {
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
diff --git a/toPairs.js b/toPairs.js
index d112b6be7..254faabd3 100644
--- a/toPairs.js
+++ b/toPairs.js
@@ -1,4 +1,4 @@
-define(['./internal/baseToPairs', './keys'], function(baseToPairs, keys) {
+define(['./_baseToPairs', './keys'], function(baseToPairs, keys) {
/**
* Creates an array of own enumerable key-value pairs for `object`.
diff --git a/toPairsIn.js b/toPairsIn.js
index 0275bc114..778eabba0 100644
--- a/toPairsIn.js
+++ b/toPairsIn.js
@@ -1,4 +1,4 @@
-define(['./internal/baseToPairs', './keysIn'], function(baseToPairs, keysIn) {
+define(['./_baseToPairs', './keysIn'], function(baseToPairs, keysIn) {
/**
* Creates an array of own and inherited enumerable key-value pairs for `object`.
diff --git a/toPath.js b/toPath.js
index 7826f4228..a08cf4045 100644
--- a/toPath.js
+++ b/toPath.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayMap', './isArray', './internal/stringToPath'], function(arrayMap, isArray, stringToPath) {
+define(['./_arrayMap', './isArray', './_stringToPath'], function(arrayMap, isArray, stringToPath) {
/**
* Converts `value` to a property path array.
diff --git a/toPlainObject.js b/toPlainObject.js
index 21b5f5158..1f0f5d4aa 100644
--- a/toPlainObject.js
+++ b/toPlainObject.js
@@ -1,4 +1,4 @@
-define(['./internal/copyObject', './keysIn'], function(copyObject, keysIn) {
+define(['./_copyObject', './keysIn'], function(copyObject, keysIn) {
/**
* Converts `value` to a plain object flattening inherited enumerable
diff --git a/toSafeInteger.js b/toSafeInteger.js
index c4259968f..dfb7a478a 100644
--- a/toSafeInteger.js
+++ b/toSafeInteger.js
@@ -1,4 +1,4 @@
-define(['./internal/baseClamp', './toInteger'], function(baseClamp, toInteger) {
+define(['./_baseClamp', './toInteger'], function(baseClamp, toInteger) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
diff --git a/toString.js b/toString.js
index 5f00dc45e..3f2ffd1aa 100644
--- a/toString.js
+++ b/toString.js
@@ -1,4 +1,4 @@
-define(['./internal/Symbol', './isSymbol'], function(Symbol, isSymbol) {
+define(['./_Symbol', './isSymbol'], function(Symbol, isSymbol) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/transform.js b/transform.js
index 6d1b4c214..28e6c506e 100644
--- a/transform.js
+++ b/transform.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayEach', './internal/baseCreate', './internal/baseForOwn', './internal/baseIteratee', './isArray', './isFunction', './isObject', './isTypedArray'], function(arrayEach, baseCreate, baseForOwn, baseIteratee, isArray, isFunction, isObject, isTypedArray) {
+define(['./_arrayEach', './_baseCreate', './_baseForOwn', './_baseIteratee', './isArray', './isFunction', './isObject', './isTypedArray'], function(arrayEach, baseCreate, baseForOwn, baseIteratee, isArray, isFunction, isObject, isTypedArray) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
@@ -23,12 +23,12 @@ define(['./internal/arrayEach', './internal/baseCreate', './internal/baseForOwn'
* _.transform([2, 3, 4], function(result, n) {
* result.push(n *= n);
* return n % 2 == 0;
- * });
+ * }, []);
* // => [4, 9]
*
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
- * });
+ * }, {});
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function transform(object, iteratee, accumulator) {
diff --git a/trim.js b/trim.js
index 1e338099c..6173b0571 100644
--- a/trim.js
+++ b/trim.js
@@ -1,4 +1,4 @@
-define(['./internal/charsEndIndex', './internal/charsStartIndex', './internal/stringToArray', './toString'], function(charsEndIndex, charsStartIndex, stringToArray, toString) {
+define(['./_charsEndIndex', './_charsStartIndex', './_stringToArray', './toString'], function(charsEndIndex, charsStartIndex, stringToArray, toString) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/trimEnd.js b/trimEnd.js
index d3e37e9e5..8544879c7 100644
--- a/trimEnd.js
+++ b/trimEnd.js
@@ -1,4 +1,4 @@
-define(['./internal/charsEndIndex', './internal/stringToArray', './toString'], function(charsEndIndex, stringToArray, toString) {
+define(['./_charsEndIndex', './_stringToArray', './toString'], function(charsEndIndex, stringToArray, toString) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/trimStart.js b/trimStart.js
index dd8f761fb..080c99a6c 100644
--- a/trimStart.js
+++ b/trimStart.js
@@ -1,4 +1,4 @@
-define(['./internal/charsStartIndex', './internal/stringToArray', './toString'], function(charsStartIndex, stringToArray, toString) {
+define(['./_charsStartIndex', './_stringToArray', './toString'], function(charsStartIndex, stringToArray, toString) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/truncate.js b/truncate.js
index e95617c8e..d2e9da641 100644
--- a/truncate.js
+++ b/truncate.js
@@ -1,4 +1,4 @@
-define(['./isObject', './isRegExp', './internal/stringSize', './internal/stringToArray', './toInteger', './toString'], function(isObject, isRegExp, stringSize, stringToArray, toInteger, toString) {
+define(['./isObject', './isRegExp', './_stringSize', './_stringToArray', './toInteger', './toString'], function(isObject, isRegExp, stringSize, stringToArray, toInteger, toString) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/unescape.js b/unescape.js
index 5336ed732..caed0ff26 100644
--- a/unescape.js
+++ b/unescape.js
@@ -1,4 +1,4 @@
-define(['./toString', './internal/unescapeHtmlChar'], function(toString, unescapeHtmlChar) {
+define(['./toString', './_unescapeHtmlChar'], function(toString, unescapeHtmlChar) {
/** Used to match HTML entities and HTML characters. */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
diff --git a/union.js b/union.js
index 4451d888b..a3eb63ce7 100644
--- a/union.js
+++ b/union.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFlatten', './internal/baseUniq', './rest'], function(baseFlatten, baseUniq, rest) {
+define(['./_baseFlatten', './_baseUniq', './rest'], function(baseFlatten, baseUniq, rest) {
/**
* Creates an array of unique values, in order, from all of the provided arrays
diff --git a/unionBy.js b/unionBy.js
index 2f4f2254f..b3d99fe31 100644
--- a/unionBy.js
+++ b/unionBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFlatten', './internal/baseIteratee', './internal/baseUniq', './isArrayLikeObject', './last', './rest'], function(baseFlatten, baseIteratee, baseUniq, isArrayLikeObject, last, rest) {
+define(['./_baseFlatten', './_baseIteratee', './_baseUniq', './isArrayLikeObject', './last', './rest'], function(baseFlatten, baseIteratee, baseUniq, isArrayLikeObject, last, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/unionWith.js b/unionWith.js
index 152b0fcdf..72e2cd04c 100644
--- a/unionWith.js
+++ b/unionWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseFlatten', './internal/baseUniq', './isArrayLikeObject', './last', './rest'], function(baseFlatten, baseUniq, isArrayLikeObject, last, rest) {
+define(['./_baseFlatten', './_baseUniq', './isArrayLikeObject', './last', './rest'], function(baseFlatten, baseUniq, isArrayLikeObject, last, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/uniq.js b/uniq.js
index 77df6d176..aeca96e3d 100644
--- a/uniq.js
+++ b/uniq.js
@@ -1,4 +1,4 @@
-define(['./internal/baseUniq'], function(baseUniq) {
+define(['./_baseUniq'], function(baseUniq) {
/**
* Creates a duplicate-free version of an array, using
diff --git a/uniqBy.js b/uniqBy.js
index e589ea2d1..492e64dde 100644
--- a/uniqBy.js
+++ b/uniqBy.js
@@ -1,4 +1,4 @@
-define(['./internal/baseIteratee', './internal/baseUniq'], function(baseIteratee, baseUniq) {
+define(['./_baseIteratee', './_baseUniq'], function(baseIteratee, baseUniq) {
/**
* This method is like `_.uniq` except that it accepts `iteratee` which is
diff --git a/uniqWith.js b/uniqWith.js
index d86c27b2a..d88cc8a19 100644
--- a/uniqWith.js
+++ b/uniqWith.js
@@ -1,4 +1,4 @@
-define(['./internal/baseUniq'], function(baseUniq) {
+define(['./_baseUniq'], function(baseUniq) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/unset.js b/unset.js
index 4f0a7f4f0..4c43c5579 100644
--- a/unset.js
+++ b/unset.js
@@ -1,4 +1,4 @@
-define(['./internal/baseUnset'], function(baseUnset) {
+define(['./_baseUnset'], function(baseUnset) {
/**
* Removes the property at `path` of `object`.
diff --git a/unzip.js b/unzip.js
index 24c483276..431e34210 100644
--- a/unzip.js
+++ b/unzip.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayFilter', './internal/arrayMap', './internal/baseProperty', './internal/baseTimes', './isArrayLikeObject'], function(arrayFilter, arrayMap, baseProperty, baseTimes, isArrayLikeObject) {
+define(['./_arrayFilter', './_arrayMap', './_baseProperty', './_baseTimes', './isArrayLikeObject'], function(arrayFilter, arrayMap, baseProperty, baseTimes, isArrayLikeObject) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
diff --git a/unzipWith.js b/unzipWith.js
index 53d0b1f93..a52411a11 100644
--- a/unzipWith.js
+++ b/unzipWith.js
@@ -1,4 +1,4 @@
-define(['./internal/apply', './internal/arrayMap', './unzip'], function(apply, arrayMap, unzip) {
+define(['./_apply', './_arrayMap', './unzip'], function(apply, arrayMap, unzip) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/upperCase.js b/upperCase.js
index ed318e5c4..cba4b0ec6 100644
--- a/upperCase.js
+++ b/upperCase.js
@@ -1,4 +1,4 @@
-define(['./internal/createCompounder'], function(createCompounder) {
+define(['./_createCompounder'], function(createCompounder) {
/**
* Converts `string`, as space separated words, to upper case.
diff --git a/upperFirst.js b/upperFirst.js
index 385ff4b18..5ef818936 100644
--- a/upperFirst.js
+++ b/upperFirst.js
@@ -1,4 +1,4 @@
-define(['./internal/createCaseFirst'], function(createCaseFirst) {
+define(['./_createCaseFirst'], function(createCaseFirst) {
/**
* Converts the first character of `string` to upper case.
diff --git a/values.js b/values.js
index 31c4e21b2..80f79bebc 100644
--- a/values.js
+++ b/values.js
@@ -1,4 +1,4 @@
-define(['./internal/baseValues', './keys'], function(baseValues, keys) {
+define(['./_baseValues', './keys'], function(baseValues, keys) {
/**
* Creates an array of the own enumerable property values of `object`.
diff --git a/valuesIn.js b/valuesIn.js
index c3cc7f483..549c56acc 100644
--- a/valuesIn.js
+++ b/valuesIn.js
@@ -1,4 +1,4 @@
-define(['./internal/baseValues', './keysIn'], function(baseValues, keysIn) {
+define(['./_baseValues', './keysIn'], function(baseValues, keysIn) {
/**
* Creates an array of the own and inherited enumerable property values of `object`.
diff --git a/without.js b/without.js
index 0877c143b..ffce92935 100644
--- a/without.js
+++ b/without.js
@@ -1,4 +1,4 @@
-define(['./internal/baseDifference', './isArrayLikeObject', './rest'], function(baseDifference, isArrayLikeObject, rest) {
+define(['./_baseDifference', './isArrayLikeObject', './rest'], function(baseDifference, isArrayLikeObject, rest) {
/**
* Creates an array excluding all provided values using
diff --git a/wrapperAt.js b/wrapperAt.js
index 49109edf3..ef2ae8230 100644
--- a/wrapperAt.js
+++ b/wrapperAt.js
@@ -1,4 +1,4 @@
-define(['./internal/LazyWrapper', './internal/LodashWrapper', './internal/baseAt', './internal/baseFlatten', './internal/isIndex', './rest', './thru'], function(LazyWrapper, LodashWrapper, baseAt, baseFlatten, isIndex, rest, thru) {
+define(['./_LazyWrapper', './_LodashWrapper', './_baseAt', './_baseFlatten', './_isIndex', './rest', './thru'], function(LazyWrapper, LodashWrapper, baseAt, baseFlatten, isIndex, rest, thru) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/wrapperLodash.js b/wrapperLodash.js
index fb37d5775..cb116c90d 100644
--- a/wrapperLodash.js
+++ b/wrapperLodash.js
@@ -1,4 +1,4 @@
-define(['./internal/LazyWrapper', './internal/LodashWrapper', './internal/baseLodash', './isArray', './isObjectLike', './internal/wrapperClone'], function(LazyWrapper, LodashWrapper, baseLodash, isArray, isObjectLike, wrapperClone) {
+define(['./_LazyWrapper', './_LodashWrapper', './_baseLodash', './isArray', './isObjectLike', './_wrapperClone'], function(LazyWrapper, LodashWrapper, baseLodash, isArray, isObjectLike, wrapperClone) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
@@ -52,20 +52,21 @@ define(['./internal/LazyWrapper', './internal/LodashWrapper', './internal/baseLo
* `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`,
* `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`,
* `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`,
- * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`,
- * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,
- * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,
- * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,
- * `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,
- * `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,
- * `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`,
- * `reject`, `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`,
- * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`,
- * `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`,
- * `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`,
- * `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`,
- * `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `without`,
- * `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, and `zipWith`
+ * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`,
+ * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`,
+ * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`,
+ * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`,
+ * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`,
+ * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`,
+ * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`,
+ * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,
+ * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,
+ * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,
+ * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,
+ * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,
+ * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`,
+ * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,
+ * `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
diff --git a/wrapperReverse.js b/wrapperReverse.js
index 443e8374c..aac9250c7 100644
--- a/wrapperReverse.js
+++ b/wrapperReverse.js
@@ -1,4 +1,4 @@
-define(['./internal/LazyWrapper', './internal/LodashWrapper', './reverse', './thru'], function(LazyWrapper, LodashWrapper, reverse, thru) {
+define(['./_LazyWrapper', './_LodashWrapper', './reverse', './thru'], function(LazyWrapper, LodashWrapper, reverse, thru) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/wrapperValue.js b/wrapperValue.js
index 602c715c8..3c6d805c0 100644
--- a/wrapperValue.js
+++ b/wrapperValue.js
@@ -1,4 +1,4 @@
-define(['./internal/baseWrapperValue'], function(baseWrapperValue) {
+define(['./_baseWrapperValue'], function(baseWrapperValue) {
/**
* Executes the chained sequence to extract the unwrapped value.
diff --git a/xor.js b/xor.js
index fb318d3ae..24d09b039 100644
--- a/xor.js
+++ b/xor.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayFilter', './internal/baseXor', './isArrayLikeObject', './rest'], function(arrayFilter, baseXor, isArrayLikeObject, rest) {
+define(['./_arrayFilter', './_baseXor', './isArrayLikeObject', './rest'], function(arrayFilter, baseXor, isArrayLikeObject, rest) {
/**
* Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
diff --git a/xorBy.js b/xorBy.js
index 8d0905d09..e2e8d0377 100644
--- a/xorBy.js
+++ b/xorBy.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayFilter', './internal/baseIteratee', './internal/baseXor', './isArrayLikeObject', './last', './rest'], function(arrayFilter, baseIteratee, baseXor, isArrayLikeObject, last, rest) {
+define(['./_arrayFilter', './_baseIteratee', './_baseXor', './isArrayLikeObject', './last', './rest'], function(arrayFilter, baseIteratee, baseXor, isArrayLikeObject, last, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/xorWith.js b/xorWith.js
index fce94ca13..25faf26e7 100644
--- a/xorWith.js
+++ b/xorWith.js
@@ -1,4 +1,4 @@
-define(['./internal/arrayFilter', './internal/baseXor', './isArrayLikeObject', './last', './rest'], function(arrayFilter, baseXor, isArrayLikeObject, last, rest) {
+define(['./_arrayFilter', './_baseXor', './isArrayLikeObject', './last', './rest'], function(arrayFilter, baseXor, isArrayLikeObject, last, rest) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
diff --git a/zipObject.js b/zipObject.js
index 1dab8293e..b903d7743 100644
--- a/zipObject.js
+++ b/zipObject.js
@@ -1,7 +1,4 @@
-define(['./internal/baseSet'], function(baseSet) {
-
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
- var undefined;
+define(['./_assignValue', './_baseZipObject'], function(assignValue, baseZipObject) {
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
@@ -15,19 +12,11 @@ define(['./internal/baseSet'], function(baseSet) {
* @returns {Object} Returns the new object.
* @example
*
- * _.zipObject(['fred', 'barney'], [30, 40]);
- * // => { 'fred': 30, 'barney': 40 }
+ * _.zipObject(['a', 'b'], [1, 2]);
+ * // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
- var index = -1,
- length = props ? props.length : 0,
- valsLength = values ? values.length : 0,
- result = {};
-
- while (++index < length) {
- baseSet(result, props[index], index < valsLength ? values[index] : undefined);
- }
- return result;
+ return baseZipObject(props || [], values || [], assignValue);
}
return zipObject;
diff --git a/zipObjectDeep.js b/zipObjectDeep.js
new file mode 100644
index 000000000..5a2a0cd4e
--- /dev/null
+++ b/zipObjectDeep.js
@@ -0,0 +1,22 @@
+define(['./_baseSet', './_baseZipObject'], function(baseSet, baseZipObject) {
+
+ /**
+ * This method is like `_.zipObject` except that it supports property paths.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} [props=[]] The property names.
+ * @param {Array} [values=[]] The property values.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
+ * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
+ */
+ function zipObjectDeep(props, values) {
+ return baseZipObject(props || [], values || [], baseSet);
+ }
+
+ return zipObjectDeep;
+});