mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Rebuild docs and dist.
This commit is contained in:
69
dist/lodash.compat.js
vendored
69
dist/lodash.compat.js
vendored
@@ -1274,9 +1274,12 @@
|
||||
* @returns {Array} Returns a new array of filtered values.
|
||||
*/
|
||||
function baseDifference(array, values) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
var index = -1,
|
||||
indexOf = getIndexOf(),
|
||||
length = array ? array.length : 0,
|
||||
result = [];
|
||||
|
||||
if (createCache && values && indexOf === baseIndexOf && values.length >= LARGE_ARRAY_SIZE) {
|
||||
@@ -1448,7 +1451,6 @@
|
||||
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
||||
*/
|
||||
function baseIsEqual(a, b, callback, isWhere, stackA, stackB) {
|
||||
// used to indicate that when comparing objects, `a` has at least the properties of `b`
|
||||
if (callback) {
|
||||
var result = callback(a, b);
|
||||
if (typeof result != 'undefined') {
|
||||
@@ -1464,16 +1466,10 @@
|
||||
otherType = typeof b;
|
||||
|
||||
// exit early for unlike primitive values
|
||||
if (a === a &&
|
||||
!(a && (type == 'function' || type == 'object')) &&
|
||||
!(b && (otherType == 'function' || otherType == 'object'))) {
|
||||
if (a === a && (a == null || b == null ||
|
||||
(type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
|
||||
return false;
|
||||
}
|
||||
// exit early for `null` and `undefined` avoiding ES3's Function#call behavior
|
||||
// http://es5.github.io/#x15.3.4.4
|
||||
if (a == null || b == null) {
|
||||
return a === b;
|
||||
}
|
||||
// compare [[Class]] names
|
||||
var className = toString.call(a),
|
||||
otherClass = toString.call(b);
|
||||
@@ -1498,7 +1494,7 @@
|
||||
// treat `NaN` vs. `NaN` as equal
|
||||
return (a != +a)
|
||||
? b != +b
|
||||
// but treat `+0` vs. `-0` as not equal
|
||||
// but treat `-0` vs. `+0` as not equal
|
||||
: (a == 0 ? (1 / a == 1 / b) : a == +b);
|
||||
|
||||
case regexpClass:
|
||||
@@ -1695,9 +1691,12 @@
|
||||
* @returns {Array} Returns a duplicate-value-free array.
|
||||
*/
|
||||
function baseUniq(array, isSorted, callback) {
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
var index = -1,
|
||||
indexOf = getIndexOf(),
|
||||
length = array ? array.length : 0,
|
||||
isLarge = createCache && !isSorted && indexOf === baseIndexOf && length >= LARGE_ARRAY_SIZE,
|
||||
result = [];
|
||||
|
||||
@@ -2384,9 +2383,12 @@
|
||||
* // => ['hoppy', 'baby puss', 'dino']
|
||||
*/
|
||||
function flatten(array, isShallow, callback, thisArg) {
|
||||
var type = typeof isShallow;
|
||||
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
// juggle arguments
|
||||
var type = typeof isShallow;
|
||||
if (type != 'boolean' && isShallow != null) {
|
||||
thisArg = callback;
|
||||
callback = isShallow;
|
||||
@@ -2990,8 +2992,8 @@
|
||||
while (low < high) {
|
||||
var mid = (low + high) >>> 1;
|
||||
(callback(array[mid]) < value)
|
||||
? low = mid + 1
|
||||
: high = mid;
|
||||
? (low = mid + 1)
|
||||
: (high = mid);
|
||||
}
|
||||
return low;
|
||||
}
|
||||
@@ -3062,9 +3064,12 @@
|
||||
* // => [{ 'x': 1 }, { 'x': 2 }]
|
||||
*/
|
||||
function uniq(array, isSorted, callback, thisArg) {
|
||||
var type = typeof isSorted;
|
||||
|
||||
var length = array ? array.length : 0;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
// juggle arguments
|
||||
var type = typeof isSorted;
|
||||
if (type != 'boolean' && isSorted != null) {
|
||||
thisArg = callback;
|
||||
callback = isSorted;
|
||||
@@ -3838,7 +3843,7 @@
|
||||
* _.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
|
||||
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
|
||||
*
|
||||
* _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String);
|
||||
* _.indexBy(keys, function(key) { return this.fromCharCode(key.code); }, String);
|
||||
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
|
||||
*/
|
||||
var indexBy = createAggregator(function(result, value, key) {
|
||||
@@ -5359,7 +5364,8 @@
|
||||
callback = null;
|
||||
}
|
||||
}
|
||||
return baseClone(value, isDeep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));
|
||||
callback = typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1);
|
||||
return baseClone(value, isDeep, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5405,7 +5411,8 @@
|
||||
* // => false
|
||||
*/
|
||||
function cloneDeep(value, callback, thisArg) {
|
||||
return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));
|
||||
callback = typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1);
|
||||
return baseClone(value, true, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5988,7 +5995,24 @@
|
||||
* // => true
|
||||
*/
|
||||
function isEqual(a, b, callback, thisArg) {
|
||||
return baseIsEqual(a, b, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 2));
|
||||
callback = typeof callback == 'function' && baseCreateCallback(callback, thisArg, 2);
|
||||
|
||||
if (!callback) {
|
||||
// exit early for identical values
|
||||
if (a === b) {
|
||||
// treat `-0` vs. `+0` as not equal
|
||||
return a !== 0 || (1 / a == 1 / b);
|
||||
}
|
||||
var type = typeof a,
|
||||
otherType = typeof b;
|
||||
|
||||
// exit early for unlike primitive values
|
||||
if (a === a && (a == null || b == null ||
|
||||
(type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return baseIsEqual(a, b, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7070,6 +7094,7 @@
|
||||
if (!hasOwnProperty.call(object, key)) {
|
||||
return false;
|
||||
}
|
||||
// treat `-0` vs. `+0` as not equal
|
||||
var b = object[key];
|
||||
return a === b && (a !== 0 || (1 / a == 1 / b));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user