Compare commits

...

1 Commits

Author SHA1 Message Date
John-David Dalton
466c67a8b6 Bump to v4.1.0. 2016-01-29 01:20:57 -08:00
438 changed files with 1053 additions and 896 deletions

View File

@@ -1,4 +1,4 @@
# lodash-es v4.0.1
# lodash-es v4.1.0
The [lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.
@@ -7,4 +7,4 @@ Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
$ lodash modularize exports=es -o ./
```
See the [package source](https://github.com/lodash/lodash/tree/4.0.1-es) for more details.
See the [package source](https://github.com/lodash/lodash/tree/4.1.0-es) for more details.

View File

@@ -1,4 +1,4 @@
import nativeCreate from './nativeCreate';
import nativeCreate from './_nativeCreate';
/** Used for built-in method references. */
var objectProto = Object.prototype;

View File

@@ -1,5 +1,5 @@
import baseCreate from './baseCreate';
import baseLodash from './baseLodash';
import baseCreate from './_baseCreate';
import baseLodash from './_baseLodash';
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;

View File

@@ -1,5 +1,5 @@
import baseCreate from './baseCreate';
import baseLodash from './baseLodash';
import baseCreate from './_baseCreate';
import baseLodash from './_baseLodash';
/**
* The base constructor for creating `lodash` wrapper objects.

View File

@@ -1,5 +1,5 @@
import getNative from './getNative';
import root from './root';
import getNative from './_getNative';
import root from './_root';
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');

View File

@@ -1,8 +1,8 @@
import mapClear from './mapClear';
import mapDelete from './mapDelete';
import mapGet from './mapGet';
import mapHas from './mapHas';
import mapSet from './mapSet';
import mapClear from './_mapClear';
import mapDelete from './_mapDelete';
import mapGet from './_mapGet';
import mapHas from './_mapHas';
import mapSet from './_mapSet';
/**
* Creates a map cache object to store key-value pairs.

View File

@@ -1,4 +1,4 @@
import root from './root';
import root from './_root';
/** Built-in value references. */
var Reflect = root.Reflect;

View File

@@ -1,5 +1,5 @@
import getNative from './getNative';
import root from './root';
import getNative from './_getNative';
import root from './_root';
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');

View File

@@ -1,5 +1,5 @@
import MapCache from './MapCache';
import cachePush from './cachePush';
import MapCache from './_MapCache';
import cachePush from './_cachePush';
/**
*

View File

@@ -1,8 +1,8 @@
import stackClear from './stackClear';
import stackDelete from './stackDelete';
import stackGet from './stackGet';
import stackHas from './stackHas';
import stackSet from './stackSet';
import stackClear from './_stackClear';
import stackDelete from './_stackDelete';
import stackGet from './_stackGet';
import stackHas from './_stackHas';
import stackSet from './_stackSet';
/**
* Creates a stack cache object to store key-value pairs.

View File

@@ -1,4 +1,4 @@
import root from './root';
import root from './_root';
/** Built-in value references. */
var Symbol = root.Symbol;

View File

@@ -1,4 +1,4 @@
import root from './root';
import root from './_root';
/** Built-in value references. */
var Uint8Array = root.Uint8Array;

View File

@@ -1,5 +1,5 @@
import getNative from './getNative';
import root from './root';
import getNative from './_getNative';
import root from './_root';
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');

22
_arrayAggregator.js Normal file
View File

@@ -0,0 +1,22 @@
/**
* 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;
}
export default arrayAggregator;

View File

@@ -1,4 +1,4 @@
import baseIndexOf from './baseIndexOf';
import baseIndexOf from './_baseIndexOf';
/**
* A specialized version of `_.includes` for arrays without support for

View File

@@ -1,4 +1,4 @@
import eq from '../eq';
import eq from './eq';
/** Used for built-in method references. */
var objectProto = Object.prototype;

View File

@@ -1,4 +1,4 @@
import eq from '../eq';
import eq from './eq';
/**
* This function is like `assignValue` except that it doesn't assign `undefined` values.

View File

@@ -1,4 +1,4 @@
import eq from '../eq';
import eq from './eq';
/** Used for built-in method references. */
var objectProto = Object.prototype;

View File

@@ -1,4 +1,4 @@
import assocIndexOf from './assocIndexOf';
import assocIndexOf from './_assocIndexOf';
/** Used for built-in method references. */
var arrayProto = Array.prototype;

View File

@@ -1,4 +1,4 @@
import assocIndexOf from './assocIndexOf';
import assocIndexOf from './_assocIndexOf';
/**
* Gets the associative array value for `key`.

View File

@@ -1,4 +1,4 @@
import assocIndexOf from './assocIndexOf';
import assocIndexOf from './_assocIndexOf';
/**
* Checks if an associative array value for `key` exists.

View File

@@ -1,4 +1,4 @@
import eq from '../eq';
import eq from './eq';
/**
* Gets the index at which the first occurrence of `key` is found in `array`

View File

@@ -1,4 +1,4 @@
import assocIndexOf from './assocIndexOf';
import assocIndexOf from './_assocIndexOf';
/**
* Sets the associative array `key` to `value`.

21
_baseAggregator.js Normal file
View File

@@ -0,0 +1,21 @@
import baseEach from './_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;
}
export default baseAggregator;

View File

@@ -1,5 +1,5 @@
import copyObject from './copyObject';
import keys from '../keys';
import copyObject from './_copyObject';
import keys from './keys';
/**
* The base implementation of `_.assign` without support for multiple sources

View File

@@ -1,4 +1,4 @@
import get from '../get';
import get from './get';
/**
* The base implementation of `_.at` without support for individual paths.

View File

@@ -1,17 +1,17 @@
import Stack from './Stack';
import arrayEach from './arrayEach';
import assignValue from './assignValue';
import baseAssign from './baseAssign';
import baseForOwn from './baseForOwn';
import copyArray from './copyArray';
import copySymbols from './copySymbols';
import getTag from './getTag';
import initCloneArray from './initCloneArray';
import initCloneByTag from './initCloneByTag';
import initCloneObject from './initCloneObject';
import isArray from '../isArray';
import isHostObject from './isHostObject';
import isObject from '../isObject';
import Stack from './_Stack';
import arrayEach from './_arrayEach';
import assignValue from './_assignValue';
import baseAssign from './_baseAssign';
import baseForOwn from './_baseForOwn';
import copyArray from './_copyArray';
import copySymbols from './_copySymbols';
import getTag from './_getTag';
import initCloneArray from './_initCloneArray';
import initCloneByTag from './_initCloneByTag';
import initCloneObject from './_initCloneObject';
import isArray from './isArray';
import isHostObject from './_isHostObject';
import isObject from './isObject';
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',

View File

@@ -1,4 +1,4 @@
import keys from '../keys';
import keys from './keys';
/**
* The base implementation of `_.conforms` which doesn't clone `source`.

View File

@@ -1,4 +1,4 @@
import isObject from '../isObject';
import isObject from './isObject';
/**
* The base implementation of `_.create` without support for assigning

View File

@@ -1,9 +1,9 @@
import SetCache from './SetCache';
import arrayIncludes from './arrayIncludes';
import arrayIncludesWith from './arrayIncludesWith';
import arrayMap from './arrayMap';
import baseUnary from './baseUnary';
import cacheHas from './cacheHas';
import SetCache from './_SetCache';
import arrayIncludes from './_arrayIncludes';
import arrayIncludesWith from './_arrayIncludesWith';
import arrayMap from './_arrayMap';
import baseUnary from './_baseUnary';
import cacheHas from './_cacheHas';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;

View File

@@ -1,5 +1,5 @@
import baseForOwn from './baseForOwn';
import createBaseEach from './createBaseEach';
import baseForOwn from './_baseForOwn';
import createBaseEach from './_createBaseEach';
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.

View File

@@ -1,5 +1,5 @@
import baseForOwnRight from './baseForOwnRight';
import createBaseEach from './createBaseEach';
import baseForOwnRight from './_baseForOwnRight';
import createBaseEach from './_createBaseEach';
/**
* The base implementation of `_.forEachRight` without support for iteratee shorthands.

View File

@@ -1,4 +1,4 @@
import baseEach from './baseEach';
import baseEach from './_baseEach';
/**
* The base implementation of `_.every` without support for iteratee shorthands.

View File

@@ -1,5 +1,5 @@
import toInteger from '../toInteger';
import toLength from '../toLength';
import toInteger from './toInteger';
import toLength from './toLength';
/**
* The base implementation of `_.fill` without an iteratee call guard.

View File

@@ -1,4 +1,4 @@
import baseEach from './baseEach';
import baseEach from './_baseEach';
/**
* The base implementation of `_.filter` without support for iteratee shorthands.

View File

@@ -1,7 +1,7 @@
import arrayPush from './arrayPush';
import isArguments from '../isArguments';
import isArray from '../isArray';
import isArrayLikeObject from '../isArrayLikeObject';
import arrayPush from './_arrayPush';
import isArguments from './isArguments';
import isArray from './isArray';
import isArrayLikeObject from './isArrayLikeObject';
/**
* The base implementation of `_.flatten` with support for restricting flattening.

View File

@@ -1,4 +1,4 @@
import createBaseFor from './createBaseFor';
import createBaseFor from './_createBaseFor';
/**
* The base implementation of `baseForIn` and `baseForOwn` which iterates

View File

@@ -1,5 +1,5 @@
import baseFor from './baseFor';
import keysIn from '../keysIn';
import baseFor from './_baseFor';
import keysIn from './keysIn';
/**
* The base implementation of `_.forIn` without support for iteratee shorthands.

View File

@@ -1,5 +1,5 @@
import baseFor from './baseFor';
import keys from '../keys';
import baseFor from './_baseFor';
import keys from './keys';
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.

View File

@@ -1,5 +1,5 @@
import baseForRight from './baseForRight';
import keys from '../keys';
import baseForRight from './_baseForRight';
import keys from './keys';
/**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands.

View File

@@ -1,4 +1,4 @@
import createBaseFor from './createBaseFor';
import createBaseFor from './_createBaseFor';
/**
* This function is like `baseFor` except that it iterates over properties

View File

@@ -1,5 +1,5 @@
import arrayFilter from './arrayFilter';
import isFunction from '../isFunction';
import arrayFilter from './_arrayFilter';
import isFunction from './isFunction';
/**
* The base implementation of `_.functions` which creates an array of

View File

@@ -1,5 +1,5 @@
import baseToPath from './baseToPath';
import isKey from './isKey';
import baseToPath from './_baseToPath';
import isKey from './_isKey';
/**
* The base implementation of `_.get` without support for default values.

View File

@@ -1,4 +1,4 @@
import indexOfNaN from './indexOfNaN';
import indexOfNaN from './_indexOfNaN';
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.

View File

@@ -1,9 +1,9 @@
import SetCache from './SetCache';
import arrayIncludes from './arrayIncludes';
import arrayIncludesWith from './arrayIncludesWith';
import arrayMap from './arrayMap';
import baseUnary from './baseUnary';
import cacheHas from './cacheHas';
import SetCache from './_SetCache';
import arrayIncludes from './_arrayIncludes';
import arrayIncludesWith from './_arrayIncludesWith';
import arrayMap from './_arrayMap';
import baseUnary from './_baseUnary';
import cacheHas from './_cacheHas';
/**
* The base implementation of methods like `_.intersection`, without support

21
_baseInverter.js Normal file
View File

@@ -0,0 +1,21 @@
import baseForOwn from './_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;
}
export default baseInverter;

View File

@@ -1,8 +1,8 @@
import apply from './apply';
import baseToPath from './baseToPath';
import isKey from './isKey';
import last from '../last';
import parent from './parent';
import apply from './_apply';
import baseToPath from './_baseToPath';
import isKey from './_isKey';
import last from './last';
import parent from './_parent';
/**
* The base implementation of `_.invoke` without support for individual

View File

@@ -1,6 +1,6 @@
import baseIsEqualDeep from './baseIsEqualDeep';
import isObject from '../isObject';
import isObjectLike from '../isObjectLike';
import baseIsEqualDeep from './_baseIsEqualDeep';
import isObject from './isObject';
import isObjectLike from './isObjectLike';
/**
* The base implementation of `_.isEqual` which supports partial comparisons

View File

@@ -1,11 +1,11 @@
import Stack from './Stack';
import equalArrays from './equalArrays';
import equalByTag from './equalByTag';
import equalObjects from './equalObjects';
import getTag from './getTag';
import isArray from '../isArray';
import isHostObject from './isHostObject';
import isTypedArray from '../isTypedArray';
import Stack from './_Stack';
import equalArrays from './_equalArrays';
import equalByTag from './_equalByTag';
import equalObjects from './_equalObjects';
import getTag from './_getTag';
import isArray from './isArray';
import isHostObject from './_isHostObject';
import isTypedArray from './isTypedArray';
/** Used to compose bitmasks for comparison styles. */
var PARTIAL_COMPARE_FLAG = 2;

View File

@@ -1,5 +1,5 @@
import Stack from './Stack';
import baseIsEqual from './baseIsEqual';
import Stack from './_Stack';
import baseIsEqual from './_baseIsEqual';
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,

View File

@@ -1,8 +1,8 @@
import baseMatches from './baseMatches';
import baseMatchesProperty from './baseMatchesProperty';
import identity from '../identity';
import isArray from '../isArray';
import property from '../property';
import baseMatches from './_baseMatches';
import baseMatchesProperty from './_baseMatchesProperty';
import identity from './identity';
import isArray from './isArray';
import property from './property';
/**
* The base implementation of `_.iteratee`.

View File

@@ -1,5 +1,5 @@
import Reflect from './Reflect';
import iteratorToArray from './iteratorToArray';
import Reflect from './_Reflect';
import iteratorToArray from './_iteratorToArray';
/** Used for built-in method references. */
var objectProto = Object.prototype;

View File

@@ -1,5 +1,5 @@
import baseEach from './baseEach';
import isArrayLike from '../isArrayLike';
import baseEach from './_baseEach';
import isArrayLike from './isArrayLike';
/**
* The base implementation of `_.map` without support for iteratee shorthands.

View File

@@ -1,5 +1,5 @@
import baseIsMatch from './baseIsMatch';
import getMatchData from './getMatchData';
import baseIsMatch from './_baseIsMatch';
import getMatchData from './_getMatchData';
/**
* The base implementation of `_.matches` which doesn't clone `source`.

View File

@@ -1,6 +1,6 @@
import baseIsEqual from './baseIsEqual';
import get from '../get';
import hasIn from '../hasIn';
import baseIsEqual from './_baseIsEqual';
import get from './get';
import hasIn from './hasIn';
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,

View File

@@ -1,11 +1,11 @@
import Stack from './Stack';
import arrayEach from './arrayEach';
import assignMergeValue from './assignMergeValue';
import baseMergeDeep from './baseMergeDeep';
import isArray from '../isArray';
import isObject from '../isObject';
import isTypedArray from '../isTypedArray';
import keysIn from '../keysIn';
import Stack from './_Stack';
import arrayEach from './_arrayEach';
import assignMergeValue from './_assignMergeValue';
import baseMergeDeep from './_baseMergeDeep';
import isArray from './isArray';
import isObject from './isObject';
import isTypedArray from './isTypedArray';
import keysIn from './keysIn';
/**
* The base implementation of `_.merge` without support for multiple sources.

View File

@@ -1,14 +1,14 @@
import assignMergeValue from './assignMergeValue';
import baseClone from './baseClone';
import copyArray from './copyArray';
import isArguments from '../isArguments';
import isArray from '../isArray';
import isArrayLikeObject from '../isArrayLikeObject';
import isFunction from '../isFunction';
import isObject from '../isObject';
import isPlainObject from '../isPlainObject';
import isTypedArray from '../isTypedArray';
import toPlainObject from '../toPlainObject';
import assignMergeValue from './_assignMergeValue';
import baseClone from './_baseClone';
import copyArray from './_copyArray';
import isArguments from './isArguments';
import isArray from './isArray';
import isArrayLikeObject from './isArrayLikeObject';
import isFunction from './isFunction';
import isObject from './isObject';
import isPlainObject from './isPlainObject';
import isTypedArray from './isTypedArray';
import toPlainObject from './toPlainObject';
/**
* A specialized version of `baseMerge` for arrays and objects which performs
@@ -27,7 +27,7 @@ import toPlainObject from '../toPlainObject';
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);
@@ -46,6 +46,7 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
newValue = copyArray(objValue);
}
else {
isCommon = false;
newValue = baseClone(srcValue);
}
}
@@ -54,6 +55,7 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
isCommon = false;
newValue = baseClone(srcValue);
}
else {

View File

@@ -1,8 +1,8 @@
import arrayMap from './arrayMap';
import baseIteratee from './baseIteratee';
import baseMap from './baseMap';
import baseSortBy from './baseSortBy';
import compareMultiple from './compareMultiple';
import arrayMap from './_arrayMap';
import baseIteratee from './_baseIteratee';
import baseMap from './_baseMap';
import baseSortBy from './_baseSortBy';
import compareMultiple from './_compareMultiple';
/**
* The base implementation of `_.orderBy` without param guards.

View File

@@ -1,4 +1,4 @@
import arrayReduce from './arrayReduce';
import arrayReduce from './_arrayReduce';
/**
* The base implementation of `_.pick` without support for individual

View File

@@ -1,4 +1,4 @@
import baseForIn from './baseForIn';
import baseForIn from './_baseForIn';
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.

View File

@@ -1,4 +1,4 @@
import baseGet from './baseGet';
import baseGet from './_baseGet';
/**
* A specialized version of `baseProperty` which supports deep paths.

View File

@@ -1,4 +1,4 @@
import basePullAllBy from './basePullAllBy';
import basePullAllBy from './_basePullAllBy';
/**
* The base implementation of `_.pullAll`.

View File

@@ -1,5 +1,5 @@
import arrayMap from './arrayMap';
import baseIndexOf from './baseIndexOf';
import arrayMap from './_arrayMap';
import baseIndexOf from './_baseIndexOf';
/** Used for built-in method references. */
var arrayProto = Array.prototype;

View File

@@ -1,8 +1,8 @@
import baseToPath from './baseToPath';
import isIndex from './isIndex';
import isKey from './isKey';
import last from '../last';
import parent from './parent';
import baseToPath from './_baseToPath';
import isIndex from './_isIndex';
import isKey from './_isKey';
import last from './last';
import parent from './_parent';
/** Used for built-in method references. */
var arrayProto = Array.prototype;

View File

@@ -1,8 +1,8 @@
import assignValue from './assignValue';
import baseToPath from './baseToPath';
import isIndex from './isIndex';
import isKey from './isKey';
import isObject from '../isObject';
import assignValue from './_assignValue';
import baseToPath from './_baseToPath';
import isIndex from './_isIndex';
import isKey from './_isKey';
import isObject from './isObject';
/**
* The base implementation of `_.set`.

View File

@@ -1,5 +1,5 @@
import identity from '../identity';
import metaMap from './metaMap';
import identity from './identity';
import metaMap from './_metaMap';
/**
* The base implementation of `setData` without support for hot loop detection.

View File

@@ -1,4 +1,4 @@
import baseEach from './baseEach';
import baseEach from './_baseEach';
/**
* The base implementation of `_.some` without support for iteratee shorthands.

View File

@@ -1,5 +1,5 @@
import baseSortedIndexBy from './baseSortedIndexBy';
import identity from '../identity';
import baseSortedIndexBy from './_baseSortedIndexBy';
import identity from './identity';
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295,

View File

@@ -1,4 +1,4 @@
import baseSortedUniqBy from './baseSortedUniqBy';
import baseSortedUniqBy from './_baseSortedUniqBy';
/**
* The base implementation of `_.sortedUniq`.

Some files were not shown because too many files have changed in this diff Show More