Compare commits

...

3 Commits

Author SHA1 Message Date
John-David Dalton
6b3e0da93c Bump to v4.13.1. 2016-05-23 12:31:09 -07:00
John-David Dalton
35cdf6513b Bump to v4.13.0. 2016-05-22 19:35:24 -07:00
John-David Dalton
07c844053e Bump to v4.12.0. 2016-05-08 12:23:20 -07:00
543 changed files with 3172 additions and 2865 deletions

View File

@@ -1,4 +1,4 @@
# lodash-es v4.11.2
# lodash-es v4.13.1
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.11.2-es) for more details.
See the [package source](https://github.com/lodash/lodash/tree/4.13.1-es) for more details.

View File

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

View File

@@ -1,18 +1,32 @@
import nativeCreate from './_nativeCreate';
/** Used for built-in method references. */
var objectProto = Object.prototype;
import hashClear from './_hashClear.js';
import hashDelete from './_hashDelete.js';
import hashGet from './_hashGet.js';
import hashHas from './_hashHas.js';
import hashSet from './_hashSet.js';
/**
* Creates a hash object.
*
* @private
* @constructor
* @returns {Object} Returns the new hash object.
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash() {}
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
// Avoid inheriting from `Object.prototype` when possible.
Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
export default Hash;

View File

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

32
_ListCache.js Normal file
View File

@@ -0,0 +1,32 @@
import listCacheClear from './_listCacheClear.js';
import listCacheDelete from './_listCacheDelete.js';
import listCacheGet from './_listCacheGet.js';
import listCacheHas from './_listCacheHas.js';
import listCacheSet from './_listCacheSet.js';
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
export default ListCache;

View File

@@ -1,5 +1,5 @@
import baseCreate from './_baseCreate';
import baseLodash from './_baseLodash';
import baseCreate from './_baseCreate.js';
import baseLodash from './_baseLodash.js';
/**
* 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.js';
import root from './_root.js';
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');

View File

@@ -1,32 +1,32 @@
import mapClear from './_mapClear';
import mapDelete from './_mapDelete';
import mapGet from './_mapGet';
import mapHas from './_mapHas';
import mapSet from './_mapSet';
import mapCacheClear from './_mapCacheClear.js';
import mapCacheDelete from './_mapCacheDelete.js';
import mapCacheGet from './_mapCacheGet.js';
import mapCacheHas from './_mapCacheHas.js';
import mapCacheSet from './_mapCacheSet.js';
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(values) {
function MapCache(entries) {
var index = -1,
length = values ? values.length : 0;
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = values[index];
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapClear;
MapCache.prototype['delete'] = mapDelete;
MapCache.prototype.get = mapGet;
MapCache.prototype.has = mapHas;
MapCache.prototype.set = mapSet;
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
export default MapCache;

View File

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

View File

@@ -1,4 +1,4 @@
import root from './_root';
import root from './_root.js';
/** 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.js';
import root from './_root.js';
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');

View File

@@ -1,9 +1,10 @@
import MapCache from './_MapCache';
import cachePush from './_cachePush';
import MapCache from './_MapCache.js';
import setCacheAdd from './_setCacheAdd.js';
import setCacheHas from './_setCacheHas.js';
/**
*
* Creates a set cache object to store unique values.
* Creates an array cache object to store unique values.
*
* @private
* @constructor
@@ -15,11 +16,12 @@ function SetCache(values) {
this.__data__ = new MapCache;
while (++index < length) {
this.push(values[index]);
this.add(values[index]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.push = cachePush;
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
export default SetCache;

View File

@@ -1,25 +1,19 @@
import stackClear from './_stackClear';
import stackDelete from './_stackDelete';
import stackGet from './_stackGet';
import stackHas from './_stackHas';
import stackSet from './_stackSet';
import ListCache from './_ListCache.js';
import stackClear from './_stackClear.js';
import stackDelete from './_stackDelete.js';
import stackGet from './_stackGet.js';
import stackHas from './_stackHas.js';
import stackSet from './_stackSet.js';
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(values) {
var index = -1,
length = values ? values.length : 0;
this.clear();
while (++index < length) {
var entry = values[index];
this.set(entry[0], entry[1]);
}
function Stack(entries) {
this.__data__ = new ListCache(entries);
}
// Add methods to `Stack`.

View File

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

View File

@@ -1,4 +1,4 @@
import root from './_root';
import root from './_root.js';
/** 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.js';
import root from './_root.js';
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');

View File

@@ -2,7 +2,7 @@
* A specialized version of `baseAggregator` for arrays.
*
* @private
* @param {Array} array The array to iterate over.
* @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.
@@ -10,7 +10,7 @@
*/
function arrayAggregator(array, setter, iteratee, accumulator) {
var index = -1,
length = array.length;
length = array ? array.length : 0;
while (++index < length) {
var value = array[index];

View File

@@ -1,25 +0,0 @@
/**
* Creates a new array concatenating `array` with `other`.
*
* @private
* @param {Array} array The first array to concatenate.
* @param {Array} other The second array to concatenate.
* @returns {Array} Returns the new concatenated array.
*/
function arrayConcat(array, other) {
var index = -1,
length = array.length,
othIndex = -1,
othLength = other.length,
result = Array(length + othLength);
while (++index < length) {
result[index] = array[index];
}
while (++othIndex < othLength) {
result[index++] = other[othIndex];
}
return result;
}
export default arrayConcat;

View File

@@ -3,13 +3,13 @@
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array.length;
length = array ? array.length : 0;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {

View File

@@ -3,12 +3,12 @@
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEachRight(array, iteratee) {
var length = array.length;
var length = array ? array.length : 0;
while (length--) {
if (iteratee(array[length], length, array) === false) {

View File

@@ -3,14 +3,14 @@
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
*/
function arrayEvery(array, predicate) {
var index = -1,
length = array.length;
length = array ? array.length : 0;
while (++index < length) {
if (!predicate(array[index], index, array)) {

View File

@@ -3,13 +3,13 @@
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array.length,
length = array ? array.length : 0,
resIndex = 0,
result = [];

View File

@@ -1,16 +1,17 @@
import baseIndexOf from './_baseIndexOf';
import baseIndexOf from './_baseIndexOf.js';
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} array The array to search.
* @param {Array} [array] The array to search.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
return !!array.length && baseIndexOf(array, value, 0) > -1;
var length = array ? array.length : 0;
return !!length && baseIndexOf(array, value, 0) > -1;
}
export default arrayIncludes;

View File

@@ -2,14 +2,14 @@
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} array The array to search.
* @param {Array} [array] The array to search.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array.length;
length = array ? array.length : 0;
while (++index < length) {
if (comparator(value, array[index])) {

View File

@@ -3,13 +3,13 @@
* shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array.length,
length = array ? array.length : 0,
result = Array(length);
while (++index < length) {

View File

@@ -3,7 +3,7 @@
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as
@@ -12,7 +12,7 @@
*/
function arrayReduce(array, iteratee, accumulator, initAccum) {
var index = -1,
length = array.length;
length = array ? array.length : 0;
if (initAccum && length) {
accumulator = array[++index];

View File

@@ -3,7 +3,7 @@
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the last element of `array` as
@@ -11,7 +11,7 @@
* @returns {*} Returns the accumulated value.
*/
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
var length = array.length;
var length = array ? array.length : 0;
if (initAccum && length) {
accumulator = array[--length];
}

View File

@@ -3,14 +3,14 @@
* shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array.length;
length = array ? array.length : 0;
while (++index < length) {
if (predicate(array[index], index, array)) {

View File

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

View File

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

View File

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

View File

@@ -1,16 +0,0 @@
import assocIndexOf from './_assocIndexOf';
/**
* Gets the associative array value for `key`.
*
* @private
* @param {Array} array The array to query.
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function assocGet(array, key) {
var index = assocIndexOf(array, key);
return index < 0 ? undefined : array[index][1];
}
export default assocGet;

View File

@@ -1,15 +0,0 @@
import assocIndexOf from './_assocIndexOf';
/**
* Checks if an associative array value for `key` exists.
*
* @private
* @param {Array} array The array to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function assocHas(array, key) {
return assocIndexOf(array, key) > -1;
}
export default assocHas;

View File

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

View File

@@ -1,20 +0,0 @@
import assocIndexOf from './_assocIndexOf';
/**
* Sets the associative array `key` to `value`.
*
* @private
* @param {Array} array The array to modify.
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
*/
function assocSet(array, key, value) {
var index = assocIndexOf(array, key);
if (index < 0) {
array.push([key, value]);
} else {
array[index][1] = value;
}
}
export default assocSet;

View File

@@ -1,4 +1,4 @@
import baseEach from './_baseEach';
import baseEach from './_baseEach.js';
/**
* Aggregates elements of `collection` on `accumulator` with keys transformed

View File

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

View File

@@ -1,4 +1,4 @@
import get from './get';
import get from './get.js';
/**
* The base implementation of `_.at` without support for individual paths.
@@ -6,7 +6,7 @@ import get from './get';
* @private
* @param {Object} object The object to iterate over.
* @param {string[]} paths The property paths of elements to pick.
* @returns {Array} Returns the new array of picked elements.
* @returns {Array} Returns the picked elements.
*/
function baseAt(object, paths) {
var index = -1,

View File

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

View File

@@ -1,11 +1,11 @@
import keys from './keys';
import keys from './keys.js';
/**
* The base implementation of `_.conforms` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new function.
* @returns {Function} Returns the new spec function.
*/
function baseConforms(source) {
var props = keys(source),

View File

@@ -1,4 +1,4 @@
import isObject from './isObject';
import isObject from './isObject.js';
/** Built-in value references. */
var objectCreate = Object.create;

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.js';
import arrayIncludes from './_arrayIncludes.js';
import arrayIncludesWith from './_arrayIncludesWith.js';
import arrayMap from './_arrayMap.js';
import baseUnary from './_baseUnary.js';
import cacheHas from './_cacheHas.js';
/** 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.js';
import createBaseEach from './_createBaseEach.js';
/**
* 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.js';
import createBaseEach from './_createBaseEach.js';
/**
* The base implementation of `_.forEachRight` without support for iteratee shorthands.

View File

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

View File

@@ -1,4 +1,4 @@
import isSymbol from './isSymbol';
import isSymbol from './isSymbol.js';
/**
* The base implementation of methods like `_.max` and `_.min` which accepts a

View File

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

View File

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

View File

@@ -5,12 +5,13 @@
* @private
* @param {Array} array The array to search.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromRight) {
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromRight ? length : -1;
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {

View File

@@ -1,25 +1,23 @@
/**
* The base implementation of methods like `_.find` and `_.findKey`, without
* support for iteratee shorthands, which iterates over `collection` using
* `eachFunc`.
* The base implementation of methods like `_.findKey` and `_.findLastKey`,
* without support for iteratee shorthands, which iterates over `collection`
* using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to search.
* @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`.
* @param {boolean} [retKey] Specify returning the key of the found element
* instead of the element itself.
* @returns {*} Returns the found element or its key, else `undefined`.
*/
function baseFind(collection, predicate, eachFunc, retKey) {
function baseFindKey(collection, predicate, eachFunc) {
var result;
eachFunc(collection, function(value, key, collection) {
if (predicate(value, key, collection)) {
result = retKey ? key : value;
result = key;
return false;
}
});
return result;
}
export default baseFind;
export default baseFindKey;

View File

@@ -1,5 +1,5 @@
import arrayPush from './_arrayPush';
import isFlattenable from './_isFlattenable';
import arrayPush from './_arrayPush.js';
import isFlattenable from './_isFlattenable.js';
/**
* The base implementation of `_.flatten` with support for restricting flattening.

View File

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

View File

@@ -1,5 +1,5 @@
import baseFor from './_baseFor';
import keys from './keys';
import baseFor from './_baseFor.js';
import keys from './keys.js';
/**
* 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.js';
import keys from './keys.js';
/**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands.

View File

@@ -1,4 +1,4 @@
import createBaseFor from './_createBaseFor';
import createBaseFor from './_createBaseFor.js';
/**
* 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.js';
import isFunction from './isFunction.js';
/**
* The base implementation of `_.functions` which creates an array of
@@ -8,7 +8,7 @@ import isFunction from './isFunction';
* @private
* @param {Object} object The object to inspect.
* @param {Array} props The property names to filter.
* @returns {Array} Returns the new array of filtered property names.
* @returns {Array} Returns the function names.
*/
function baseFunctions(object, props) {
return arrayFilter(props, function(key) {

View File

@@ -1,6 +1,6 @@
import castPath from './_castPath';
import isKey from './_isKey';
import toKey from './_toKey';
import castPath from './_castPath.js';
import isKey from './_isKey.js';
import toKey from './_toKey.js';
/**
* The base implementation of `_.get` without support for default values.

View File

@@ -1,5 +1,5 @@
import arrayPush from './_arrayPush';
import isArray from './isArray';
import arrayPush from './_arrayPush.js';
import isArray from './isArray.js';
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
@@ -14,9 +14,7 @@ import isArray from './isArray';
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object)
? result
: arrayPush(result, symbolsFunc(object));
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
export default baseGetAllKeys;

View File

@@ -1,4 +1,4 @@
import getPrototype from './_getPrototype';
import getPrototype from './_getPrototype.js';
/** Used for built-in method references. */
var objectProto = Object.prototype;
@@ -10,7 +10,7 @@ var hasOwnProperty = objectProto.hasOwnProperty;
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
@@ -18,8 +18,9 @@ function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null);
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
export default baseHas;

View File

@@ -2,12 +2,12 @@
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return key in Object(object);
return object != null && key in Object(object);
}
export default baseHasIn;

View File

@@ -1,4 +1,4 @@
import indexOfNaN from './_indexOfNaN';
import indexOfNaN from './_indexOfNaN.js';
/**
* 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.js';
import arrayIncludes from './_arrayIncludes.js';
import arrayIncludesWith from './_arrayIncludesWith.js';
import arrayMap from './_arrayMap.js';
import baseUnary from './_baseUnary.js';
import cacheHas from './_cacheHas.js';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;

View File

@@ -1,4 +1,4 @@
import baseForOwn from './_baseForOwn';
import baseForOwn from './_baseForOwn.js';
/**
* The base implementation of `_.invert` and `_.invertBy` which inverts

View File

@@ -1,9 +1,9 @@
import apply from './_apply';
import castPath from './_castPath';
import isKey from './_isKey';
import last from './last';
import parent from './_parent';
import toKey from './_toKey';
import apply from './_apply.js';
import castPath from './_castPath.js';
import isKey from './_isKey.js';
import last from './last.js';
import parent from './_parent.js';
import toKey from './_toKey.js';
/**
* 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.js';
import isObject from './isObject.js';
import isObjectLike from './isObjectLike.js';
/**
* 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.js';
import equalArrays from './_equalArrays.js';
import equalByTag from './_equalByTag.js';
import equalObjects from './_equalObjects.js';
import getTag from './_getTag.js';
import isArray from './isArray.js';
import isHostObject from './_isHostObject.js';
import isTypedArray from './isTypedArray.js';
/** 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.js';
import baseIsEqual from './_baseIsEqual.js';
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,

47
_baseIsNative.js Normal file
View File

@@ -0,0 +1,47 @@
import isFunction from './isFunction.js';
import isHostObject from './_isHostObject.js';
import isMasked from './_isMasked.js';
import isObject from './isObject.js';
import toSource from './_toSource.js';
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
export default baseIsNative;

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.js';
import baseMatchesProperty from './_baseMatchesProperty.js';
import identity from './identity.js';
import isArray from './isArray.js';
import property from './property.js';
/**
* The base implementation of `_.iteratee`.

View File

@@ -1,5 +1,5 @@
import Reflect from './_Reflect';
import iteratorToArray from './_iteratorToArray';
import Reflect from './_Reflect.js';
import iteratorToArray from './_iteratorToArray.js';
/** 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.js';
import isArrayLike from './isArrayLike.js';
/**
* The base implementation of `_.map` without support for iteratee shorthands.

View File

@@ -1,13 +1,13 @@
import baseIsMatch from './_baseIsMatch';
import getMatchData from './_getMatchData';
import matchesStrictComparable from './_matchesStrictComparable';
import baseIsMatch from './_baseIsMatch.js';
import getMatchData from './_getMatchData.js';
import matchesStrictComparable from './_matchesStrictComparable.js';
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new function.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);

View File

@@ -1,10 +1,10 @@
import baseIsEqual from './_baseIsEqual';
import get from './get';
import hasIn from './hasIn';
import isKey from './_isKey';
import isStrictComparable from './_isStrictComparable';
import matchesStrictComparable from './_matchesStrictComparable';
import toKey from './_toKey';
import baseIsEqual from './_baseIsEqual.js';
import get from './get.js';
import hasIn from './hasIn.js';
import isKey from './_isKey.js';
import isStrictComparable from './_isStrictComparable.js';
import matchesStrictComparable from './_matchesStrictComparable.js';
import toKey from './_toKey.js';
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,
@@ -16,7 +16,7 @@ var UNORDERED_COMPARE_FLAG = 1,
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new function.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {

View File

@@ -1,4 +1,4 @@
import baseSum from './_baseSum';
import baseSum from './_baseSum.js';
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;

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.js';
import arrayEach from './_arrayEach.js';
import assignMergeValue from './_assignMergeValue.js';
import baseMergeDeep from './_baseMergeDeep.js';
import isArray from './isArray.js';
import isObject from './isObject.js';
import isTypedArray from './isTypedArray.js';
import keysIn from './keysIn.js';
/**
* 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.js';
import baseClone from './_baseClone.js';
import copyArray from './_copyArray.js';
import isArguments from './isArguments.js';
import isArray from './isArray.js';
import isArrayLikeObject from './isArrayLikeObject.js';
import isFunction from './isFunction.js';
import isObject from './isObject.js';
import isPlainObject from './isPlainObject.js';
import isTypedArray from './isTypedArray.js';
import toPlainObject from './toPlainObject.js';
/**
* A specialized version of `baseMerge` for arrays and objects which performs

View File

@@ -1,4 +1,4 @@
import isIndex from './_isIndex';
import isIndex from './_isIndex.js';
/**
* The base implementation of `_.nth` which doesn't coerce `n` to an integer.

View File

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

View File

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

View File

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

View File

@@ -3,7 +3,7 @@
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new function.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {

View File

@@ -1,11 +1,11 @@
import baseGet from './_baseGet';
import baseGet from './_baseGet.js';
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new function.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {

View File

@@ -1,7 +1,8 @@
import arrayMap from './_arrayMap';
import baseIndexOf from './_baseIndexOf';
import baseIndexOfWith from './_baseIndexOfWith';
import baseUnary from './_baseUnary';
import arrayMap from './_arrayMap.js';
import baseIndexOf from './_baseIndexOf.js';
import baseIndexOfWith from './_baseIndexOfWith.js';
import baseUnary from './_baseUnary.js';
import copyArray from './_copyArray.js';
/** Used for built-in method references. */
var arrayProto = Array.prototype;
@@ -26,6 +27,9 @@ function basePullAll(array, values, iteratee, comparator) {
length = values.length,
seen = array;
if (array === values) {
values = copyArray(values);
}
if (iteratee) {
seen = arrayMap(array, baseUnary(iteratee));
}

View File

@@ -1,9 +1,9 @@
import castPath from './_castPath';
import isIndex from './_isIndex';
import isKey from './_isKey';
import last from './last';
import parent from './_parent';
import toKey from './_toKey';
import castPath from './_castPath.js';
import isIndex from './_isIndex.js';
import isKey from './_isKey.js';
import last from './last.js';
import parent from './_parent.js';
import toKey from './_toKey.js';
/** Used for built-in method references. */
var arrayProto = Array.prototype;

View File

@@ -11,7 +11,7 @@ var nativeCeil = Math.ceil,
* @param {number} end The end of the range.
* @param {number} step The value to increment or decrement by.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the new array of numbers.
* @returns {Array} Returns the range of numbers.
*/
function baseRange(start, end, step, fromRight) {
var index = -1,

View File

@@ -1,9 +1,9 @@
import assignValue from './_assignValue';
import castPath from './_castPath';
import isIndex from './_isIndex';
import isKey from './_isKey';
import isObject from './isObject';
import toKey from './_toKey';
import assignValue from './_assignValue.js';
import castPath from './_castPath.js';
import isIndex from './_isIndex.js';
import isKey from './_isKey.js';
import isObject from './isObject.js';
import toKey from './_toKey.js';
/**
* The base implementation of `_.set`.

View File

@@ -1,5 +1,5 @@
import identity from './identity';
import metaMap from './_metaMap';
import identity from './identity.js';
import metaMap from './_metaMap.js';
/**
* 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.js';
/**
* The base implementation of `_.some` without support for iteratee shorthands.

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
import eq from './eq';
import eq from './eq.js';
/**
* The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without

View File

@@ -1,4 +1,4 @@
import isSymbol from './isSymbol';
import isSymbol from './isSymbol.js';
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;

View File

@@ -1,4 +1,4 @@
import arrayMap from './_arrayMap';
import arrayMap from './_arrayMap.js';
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
@@ -7,7 +7,7 @@ import arrayMap from './_arrayMap';
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the new array of key-value pairs.
* @returns {Object} Returns the key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function(key) {

View File

@@ -1,5 +1,5 @@
import Symbol from './_Symbol';
import isSymbol from './isSymbol';
import Symbol from './_Symbol.js';
import isSymbol from './isSymbol.js';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

View File

@@ -3,7 +3,7 @@
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new function.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {

View File

@@ -1,9 +1,9 @@
import SetCache from './_SetCache';
import arrayIncludes from './_arrayIncludes';
import arrayIncludesWith from './_arrayIncludesWith';
import cacheHas from './_cacheHas';
import createSet from './_createSet';
import setToArray from './_setToArray';
import SetCache from './_SetCache.js';
import arrayIncludes from './_arrayIncludes.js';
import arrayIncludesWith from './_arrayIncludesWith.js';
import cacheHas from './_cacheHas.js';
import createSet from './_createSet.js';
import setToArray from './_setToArray.js';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;

View File

@@ -1,9 +1,9 @@
import baseHas from './_baseHas';
import castPath from './_castPath';
import isKey from './_isKey';
import last from './last';
import parent from './_parent';
import toKey from './_toKey';
import baseHas from './_baseHas.js';
import castPath from './_castPath.js';
import isKey from './_isKey.js';
import last from './last.js';
import parent from './_parent.js';
import toKey from './_toKey.js';
/**
* The base implementation of `_.unset`.

View File

@@ -1,5 +1,5 @@
import baseGet from './_baseGet';
import baseSet from './_baseSet';
import baseGet from './_baseGet.js';
import baseSet from './_baseSet.js';
/**
* The base implementation of `_.update`.

View File

@@ -1,4 +1,4 @@
import arrayMap from './_arrayMap';
import arrayMap from './_arrayMap.js';
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an

View File

@@ -1,4 +1,4 @@
import baseSlice from './_baseSlice';
import baseSlice from './_baseSlice.js';
/**
* The base implementation of methods like `_.dropWhile` and `_.takeWhile`

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