mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Bump to v3.0.1.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
define(['./baseMatches', './baseProperty', './baseToString', './bindCallback', '../utility/identity', './isBindable'], function(baseMatches, baseProperty, baseToString, bindCallback, identity, isBindable) {
|
||||
define(['./baseMatches', './baseProperty', './bindCallback', '../utility/identity', './isBindable'], function(baseMatches, baseProperty, bindCallback, identity, isBindable) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.callback` which supports specifying the
|
||||
@@ -23,7 +23,7 @@ define(['./baseMatches', './baseProperty', './baseToString', './bindCallback', '
|
||||
// Handle "_.property" and "_.matches" style callback shorthands.
|
||||
return type == 'object'
|
||||
? baseMatches(func, !argCount)
|
||||
: baseProperty(argCount ? baseToString(func) : func);
|
||||
: baseProperty(func + '');
|
||||
}
|
||||
|
||||
return baseCallback;
|
||||
|
||||
@@ -44,6 +44,9 @@ define(['./arrayCopy', '../lang/isArguments', '../lang/isArray', './isLength', '
|
||||
? toPlainObject(value)
|
||||
: (isPlainObject(value) ? value : {});
|
||||
}
|
||||
else {
|
||||
isCommon = false;
|
||||
}
|
||||
}
|
||||
// Add the source value to the stack of traversed objects and associate
|
||||
// it with its merged value.
|
||||
|
||||
@@ -21,7 +21,8 @@ define([], function() {
|
||||
if (end < 0) {
|
||||
end += length;
|
||||
}
|
||||
length = start > end ? 0 : (end - start);
|
||||
length = start > end ? 0 : (end - start) >>> 0;
|
||||
start >>>= 0;
|
||||
|
||||
var result = Array(length);
|
||||
while (++index < length) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseToString', '../string/repeat', './root'], function(baseToString, repeat, root) {
|
||||
define(['../string/repeat', './root'], function(repeat, root) {
|
||||
|
||||
/** Native method references. */
|
||||
var ceil = Math.ceil;
|
||||
@@ -25,7 +25,7 @@ define(['./baseToString', '../string/repeat', './root'], function(baseToString,
|
||||
return '';
|
||||
}
|
||||
var padLength = length - strLength;
|
||||
chars = chars == null ? ' ' : baseToString(chars);
|
||||
chars = chars == null ? ' ' : (chars + '');
|
||||
return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseToString'], function(baseToString) {
|
||||
define([], function() {
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var boolTag = '[object Boolean]',
|
||||
@@ -43,7 +43,7 @@ define(['./baseToString'], function(baseToString) {
|
||||
case stringTag:
|
||||
// Coerce regexes to strings and treat strings primitives and string
|
||||
// objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
|
||||
return object == baseToString(other);
|
||||
return object == (other + '');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9,11 +9,14 @@ define(['./LazyWrapper'], function(LazyWrapper) {
|
||||
* @returns {Object} Returns the new reversed `LazyWrapper` object.
|
||||
*/
|
||||
function lazyReverse() {
|
||||
var filtered = this.filtered,
|
||||
result = filtered ? new LazyWrapper(this) : this.clone();
|
||||
|
||||
result.dir = this.dir * -1;
|
||||
result.filtered = filtered;
|
||||
if (this.filtered) {
|
||||
var result = new LazyWrapper(this);
|
||||
result.dir = -1;
|
||||
result.filtered = true;
|
||||
} else {
|
||||
result = this.clone();
|
||||
result.dir *= -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@ define(['./baseWrapperValue', './getView', '../lang/isArray'], function(baseWrap
|
||||
}
|
||||
var dir = this.dir,
|
||||
isRight = dir < 0,
|
||||
length = array.length,
|
||||
view = getView(0, length, this.views),
|
||||
view = getView(0, array.length, this.views),
|
||||
start = view.start,
|
||||
end = view.end,
|
||||
length = end - start,
|
||||
dropCount = this.dropCount,
|
||||
takeCount = nativeMin(end - start, this.takeCount - dropCount),
|
||||
takeCount = nativeMin(length, this.takeCount - dropCount),
|
||||
index = isRight ? end : start - 1,
|
||||
iteratees = this.iteratees,
|
||||
iterLength = iteratees ? iteratees.length : 0,
|
||||
@@ -63,7 +63,7 @@ define(['./baseWrapperValue', './getView', '../lang/isArray'], function(baseWrap
|
||||
result[resIndex++] = value;
|
||||
}
|
||||
}
|
||||
return isRight ? result.reverse() : result;
|
||||
return result;
|
||||
}
|
||||
|
||||
return lazyValue;
|
||||
|
||||
Reference in New Issue
Block a user