Compare commits

..

2 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
514 changed files with 2625 additions and 2425 deletions

View File

@@ -1,4 +1,4 @@
# lodash-es v4.12.0 # lodash-es v4.13.1
The [Lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules. 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 ./ $ lodash modularize exports=es -o ./
``` ```
See the [package source](https://github.com/lodash/lodash/tree/4.12.0-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 getNative from './_getNative.js';
import root from './_root'; import root from './_root.js';
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'); var DataView = getNative(root, 'DataView');

View File

@@ -1,8 +1,8 @@
import hashClear from './_hashClear'; import hashClear from './_hashClear.js';
import hashDelete from './_hashDelete'; import hashDelete from './_hashDelete.js';
import hashGet from './_hashGet'; import hashGet from './_hashGet.js';
import hashHas from './_hashHas'; import hashHas from './_hashHas.js';
import hashSet from './_hashSet'; import hashSet from './_hashSet.js';
/** /**
* Creates a hash object. * Creates a hash object.

View File

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

View File

@@ -1,8 +1,8 @@
import listCacheClear from './_listCacheClear'; import listCacheClear from './_listCacheClear.js';
import listCacheDelete from './_listCacheDelete'; import listCacheDelete from './_listCacheDelete.js';
import listCacheGet from './_listCacheGet'; import listCacheGet from './_listCacheGet.js';
import listCacheHas from './_listCacheHas'; import listCacheHas from './_listCacheHas.js';
import listCacheSet from './_listCacheSet'; import listCacheSet from './_listCacheSet.js';
/** /**
* Creates an list cache object. * Creates an list cache object.

View File

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

View File

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

View File

@@ -1,8 +1,8 @@
import mapCacheClear from './_mapCacheClear'; import mapCacheClear from './_mapCacheClear.js';
import mapCacheDelete from './_mapCacheDelete'; import mapCacheDelete from './_mapCacheDelete.js';
import mapCacheGet from './_mapCacheGet'; import mapCacheGet from './_mapCacheGet.js';
import mapCacheHas from './_mapCacheHas'; import mapCacheHas from './_mapCacheHas.js';
import mapCacheSet from './_mapCacheSet'; import mapCacheSet from './_mapCacheSet.js';
/** /**
* Creates a map cache object to store key-value pairs. * Creates a map cache object to store key-value pairs.

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
import MapCache from './_MapCache'; import MapCache from './_MapCache.js';
import setCacheAdd from './_setCacheAdd'; import setCacheAdd from './_setCacheAdd.js';
import setCacheHas from './_setCacheHas'; import setCacheHas from './_setCacheHas.js';
/** /**
* *

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -3,12 +3,12 @@
* iteratee shorthands. * iteratee shorthands.
* *
* @private * @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 {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`. * @returns {Array} Returns `array`.
*/ */
function arrayEachRight(array, iteratee) { function arrayEachRight(array, iteratee) {
var length = array.length; var length = array ? array.length : 0;
while (length--) { while (length--) {
if (iteratee(array[length], length, array) === false) { if (iteratee(array[length], length, array) === false) {

View File

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

View File

@@ -3,13 +3,13 @@
* iteratee shorthands. * iteratee shorthands.
* *
* @private * @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. * @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array. * @returns {Array} Returns the new filtered array.
*/ */
function arrayFilter(array, predicate) { function arrayFilter(array, predicate) {
var index = -1, var index = -1,
length = array.length, length = array ? array.length : 0,
resIndex = 0, resIndex = 0,
result = []; 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 * A specialized version of `_.includes` for arrays without support for
* specifying an index to search from. * specifying an index to search from.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} [array] The array to search.
* @param {*} target The value to search for. * @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`. * @returns {boolean} Returns `true` if `target` is found, else `false`.
*/ */
function arrayIncludes(array, value) { 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; export default arrayIncludes;

View File

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

View File

@@ -3,13 +3,13 @@
* shorthands. * shorthands.
* *
* @private * @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 {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array. * @returns {Array} Returns the new mapped array.
*/ */
function arrayMap(array, iteratee) { function arrayMap(array, iteratee) {
var index = -1, var index = -1,
length = array.length, length = array ? array.length : 0,
result = Array(length); result = Array(length);
while (++index < length) { while (++index < length) {

View File

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

View File

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

View File

@@ -3,14 +3,14 @@
* shorthands. * shorthands.
* *
* @private * @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. * @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check, * @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`. * else `false`.
*/ */
function arraySome(array, predicate) { function arraySome(array, predicate) {
var index = -1, var index = -1,
length = array.length; length = array ? array.length : 0;
while (++index < length) { while (++index < length) {
if (predicate(array[index], index, array)) { 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. */ /** Used for built-in method references. */
var objectProto = Object.prototype; 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 * 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. */ /** Used for built-in method references. */
var objectProto = Object.prototype; var objectProto = Object.prototype;

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. * Gets the index at which the `key` is found in `array` of key-value pairs.

View File

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

View File

@@ -1,5 +1,5 @@
import copyObject from './_copyObject'; import copyObject from './_copyObject.js';
import keys from './keys'; import keys from './keys.js';
/** /**
* The base implementation of `_.assign` without support for multiple sources * 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. * The base implementation of `_.at` without support for individual paths.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
import baseForOwnRight from './_baseForOwnRight'; import baseForOwnRight from './_baseForOwnRight.js';
import createBaseEach from './_createBaseEach'; import createBaseEach from './_createBaseEach.js';
/** /**
* The base implementation of `_.forEachRight` without support for iteratee shorthands. * 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. * 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 * The base implementation of methods like `_.max` and `_.min` which accepts a

View File

@@ -1,5 +1,5 @@
import toInteger from './toInteger'; import toInteger from './toInteger.js';
import toLength from './toLength'; import toLength from './toLength.js';
/** /**
* The base implementation of `_.fill` without an iteratee call guard. * 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. * The base implementation of `_.filter` without support for iteratee shorthands.

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
import arrayPush from './_arrayPush'; import arrayPush from './_arrayPush.js';
import isFlattenable from './_isFlattenable'; import isFlattenable from './_isFlattenable.js';
/** /**
* The base implementation of `_.flatten` with support for restricting flattening. * 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` * The base implementation of `baseForOwn` which iterates over `object`

View File

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

View File

@@ -1,5 +1,5 @@
import baseForRight from './_baseForRight'; import baseForRight from './_baseForRight.js';
import keys from './keys'; import keys from './keys.js';
/** /**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands. * 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 * This function is like `baseFor` except that it iterates over properties

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
import arrayPush from './_arrayPush'; import arrayPush from './_arrayPush.js';
import isArray from './isArray'; import isArray from './isArray.js';
/** /**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses * The base implementation of `getAllKeys` and `getAllKeysIn` which uses

View File

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

View File

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

View File

@@ -1,9 +1,9 @@
import SetCache from './_SetCache'; import SetCache from './_SetCache.js';
import arrayIncludes from './_arrayIncludes'; import arrayIncludes from './_arrayIncludes.js';
import arrayIncludesWith from './_arrayIncludesWith'; import arrayIncludesWith from './_arrayIncludesWith.js';
import arrayMap from './_arrayMap'; import arrayMap from './_arrayMap.js';
import baseUnary from './_baseUnary'; import baseUnary from './_baseUnary.js';
import cacheHas from './_cacheHas'; import cacheHas from './_cacheHas.js';
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min; 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 * The base implementation of `_.invert` and `_.invertBy` which inverts

View File

@@ -1,9 +1,9 @@
import apply from './_apply'; import apply from './_apply.js';
import castPath from './_castPath'; import castPath from './_castPath.js';
import isKey from './_isKey'; import isKey from './_isKey.js';
import last from './last'; import last from './last.js';
import parent from './_parent'; import parent from './_parent.js';
import toKey from './_toKey'; import toKey from './_toKey.js';
/** /**
* The base implementation of `_.invoke` without support for individual * The base implementation of `_.invoke` without support for individual

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
import Stack from './_Stack'; import Stack from './_Stack.js';
import baseIsEqual from './_baseIsEqual'; import baseIsEqual from './_baseIsEqual.js';
/** Used to compose bitmasks for comparison styles. */ /** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1, 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 baseMatches from './_baseMatches.js';
import baseMatchesProperty from './_baseMatchesProperty'; import baseMatchesProperty from './_baseMatchesProperty.js';
import identity from './identity'; import identity from './identity.js';
import isArray from './isArray'; import isArray from './isArray.js';
import property from './property'; import property from './property.js';
/** /**
* The base implementation of `_.iteratee`. * The base implementation of `_.iteratee`.

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,10 @@
import baseIsEqual from './_baseIsEqual'; import baseIsEqual from './_baseIsEqual.js';
import get from './get'; import get from './get.js';
import hasIn from './hasIn'; import hasIn from './hasIn.js';
import isKey from './_isKey'; import isKey from './_isKey.js';
import isStrictComparable from './_isStrictComparable'; import isStrictComparable from './_isStrictComparable.js';
import matchesStrictComparable from './_matchesStrictComparable'; import matchesStrictComparable from './_matchesStrictComparable.js';
import toKey from './_toKey'; import toKey from './_toKey.js';
/** Used to compose bitmasks for comparison styles. */ /** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1, var UNORDERED_COMPARE_FLAG = 1,

View File

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

View File

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

View File

@@ -1,14 +1,14 @@
import assignMergeValue from './_assignMergeValue'; import assignMergeValue from './_assignMergeValue.js';
import baseClone from './_baseClone'; import baseClone from './_baseClone.js';
import copyArray from './_copyArray'; import copyArray from './_copyArray.js';
import isArguments from './isArguments'; import isArguments from './isArguments.js';
import isArray from './isArray'; import isArray from './isArray.js';
import isArrayLikeObject from './isArrayLikeObject'; import isArrayLikeObject from './isArrayLikeObject.js';
import isFunction from './isFunction'; import isFunction from './isFunction.js';
import isObject from './isObject'; import isObject from './isObject.js';
import isPlainObject from './isPlainObject'; import isPlainObject from './isPlainObject.js';
import isTypedArray from './isTypedArray'; import isTypedArray from './isTypedArray.js';
import toPlainObject from './toPlainObject'; import toPlainObject from './toPlainObject.js';
/** /**
* A specialized version of `baseMerge` for arrays and objects which performs * 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. * The base implementation of `_.nth` which doesn't coerce `n` to an integer.

View File

@@ -1,10 +1,10 @@
import arrayMap from './_arrayMap'; import arrayMap from './_arrayMap.js';
import baseIteratee from './_baseIteratee'; import baseIteratee from './_baseIteratee.js';
import baseMap from './_baseMap'; import baseMap from './_baseMap.js';
import baseSortBy from './_baseSortBy'; import baseSortBy from './_baseSortBy.js';
import baseUnary from './_baseUnary'; import baseUnary from './_baseUnary.js';
import compareMultiple from './_compareMultiple'; import compareMultiple from './_compareMultiple.js';
import identity from './identity'; import identity from './identity.js';
/** /**
* The base implementation of `_.orderBy` without param guards. * 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 * 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. * The base implementation of `_.pickBy` without support for iteratee shorthands.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
import baseSortedIndexBy from './_baseSortedIndexBy'; import baseSortedIndexBy from './_baseSortedIndexBy.js';
import identity from './identity'; import identity from './identity.js';
import isSymbol from './isSymbol'; import isSymbol from './isSymbol.js';
/** Used as references for the maximum length and index of an array. */ /** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295, 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. */ /** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295, 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 * 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. */ /** Used as references for various `Number` constants. */
var NAN = 0 / 0; 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 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
import baseGet from './_baseGet'; import baseGet from './_baseGet.js';
import baseSet from './_baseSet'; import baseSet from './_baseSet.js';
/** /**
* The base implementation of `_.update`. * 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 * 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` * The base implementation of methods like `_.dropWhile` and `_.takeWhile`

View File

@@ -1,6 +1,6 @@
import LazyWrapper from './_LazyWrapper'; import LazyWrapper from './_LazyWrapper.js';
import arrayPush from './_arrayPush'; import arrayPush from './_arrayPush.js';
import arrayReduce from './_arrayReduce'; import arrayReduce from './_arrayReduce.js';
/** /**
* The base implementation of `wrapperValue` which returns the result of * The base implementation of `wrapperValue` which returns the result of

View File

@@ -1,6 +1,6 @@
import arrayPush from './_arrayPush'; import arrayPush from './_arrayPush.js';
import baseDifference from './_baseDifference'; import baseDifference from './_baseDifference.js';
import baseUniq from './_baseUniq'; import baseUniq from './_baseUniq.js';
/** /**
* The base implementation of methods like `_.xor`, without support for * The base implementation of methods like `_.xor`, without support for

View File

@@ -1,4 +1,4 @@
import isArrayLikeObject from './isArrayLikeObject'; import isArrayLikeObject from './isArrayLikeObject.js';
/** /**
* Casts `value` to an empty array if it's not an array like object. * Casts `value` to an empty array if it's not an array like object.

View File

@@ -1,4 +1,4 @@
import identity from './identity'; import identity from './identity.js';
/** /**
* Casts `value` to `identity` if it's not a function. * Casts `value` to `identity` if it's not a function.

View File

@@ -1,5 +1,5 @@
import isArray from './isArray'; import isArray from './isArray.js';
import stringToPath from './_stringToPath'; import stringToPath from './_stringToPath.js';
/** /**
* Casts `value` to a path array if it's not one. * Casts `value` to a path array if it's not one.

View File

@@ -1,4 +1,4 @@
import baseSlice from './_baseSlice'; import baseSlice from './_baseSlice.js';
/** /**
* Casts `array` to a slice if it's needed. * Casts `array` to a slice if it's needed.

View File

@@ -1,4 +1,4 @@
import baseIndexOf from './_baseIndexOf'; import baseIndexOf from './_baseIndexOf.js';
/** /**
* Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol

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