mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Bump to v3.3.0.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
var baseCreate = require('./baseCreate'),
|
||||
baseLodash = require('./baseLodash');
|
||||
|
||||
/** Used as references for `-Infinity` and `Infinity`. */
|
||||
var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
|
||||
|
||||
@@ -18,4 +21,7 @@ function LazyWrapper(value) {
|
||||
this.__views__ = null;
|
||||
}
|
||||
|
||||
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
|
||||
LazyWrapper.prototype.constructor = LazyWrapper;
|
||||
|
||||
module.exports = LazyWrapper;
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
var baseCreate = require('./baseCreate'),
|
||||
baseLodash = require('./baseLodash');
|
||||
|
||||
/**
|
||||
* The base constructor for creating `lodash` wrapper objects.
|
||||
*
|
||||
@@ -12,4 +15,7 @@ function LodashWrapper(value, chainAll, actions) {
|
||||
this.__chain__ = !!chainAll;
|
||||
}
|
||||
|
||||
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
|
||||
LodashWrapper.prototype.constructor = LodashWrapper;
|
||||
|
||||
module.exports = LodashWrapper;
|
||||
|
||||
15
internal/baseIsFunction.js
Normal file
15
internal/baseIsFunction.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* The base implementation of `_.isFunction` without support for environments
|
||||
* with incorrect `typeof` results.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
||||
*/
|
||||
function baseIsFunction(value) {
|
||||
// Avoid a Chakra JIT bug in compatibility modes of IE 11.
|
||||
// See https://github.com/jashkenas/underscore/issues/1621 for more details.
|
||||
return typeof value == 'function' || false;
|
||||
}
|
||||
|
||||
module.exports = baseIsFunction;
|
||||
10
internal/baseLodash.js
Normal file
10
internal/baseLodash.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* The function whose prototype all chaining wrappers inherit from.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function baseLodash() {
|
||||
// No operation performed.
|
||||
}
|
||||
|
||||
module.exports = baseLodash;
|
||||
@@ -3,6 +3,7 @@ var arrayEach = require('./arrayEach'),
|
||||
baseMergeDeep = require('./baseMergeDeep'),
|
||||
isArray = require('../lang/isArray'),
|
||||
isLength = require('./isLength'),
|
||||
isObject = require('../lang/isObject'),
|
||||
isObjectLike = require('./isObjectLike'),
|
||||
isTypedArray = require('../lang/isTypedArray');
|
||||
|
||||
@@ -19,8 +20,10 @@ var arrayEach = require('./arrayEach'),
|
||||
* @returns {Object} Returns the destination object.
|
||||
*/
|
||||
function baseMerge(object, source, customizer, stackA, stackB) {
|
||||
if (!isObject(object)) {
|
||||
return object;
|
||||
}
|
||||
var isSrcArr = isLength(source.length) && (isArray(source) || isTypedArray(source));
|
||||
|
||||
(isSrcArr ? arrayEach : baseForOwn)(source, function(srcValue, key, source) {
|
||||
if (isObjectLike(srcValue)) {
|
||||
stackA || (stackA = []);
|
||||
|
||||
@@ -22,7 +22,8 @@ function isIterateeCall(value, index, object) {
|
||||
} else {
|
||||
prereq = type == 'string' && index in object;
|
||||
}
|
||||
return prereq && object[index] === value;
|
||||
var other = object[index];
|
||||
return prereq && (value === value ? value === other : other !== other);
|
||||
}
|
||||
|
||||
module.exports = isIterateeCall;
|
||||
|
||||
Reference in New Issue
Block a user