8000 Bump to v3.1.0. · lodash/lodash@1608d89 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1608d89

Browse files
committed
Bump to v3.1.0.
1 parent 3b2df88 commit 1608d89

21 files changed

+118
-58
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# lodash v3.0.1
1+
# lodash v3.1.0
22

33
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
44

chain/lodash.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ define(['../internal/LodashWrapper', '../internal/arrayCopy', '../lang/isArray',
5454
* `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`,
5555
* `identity`, `includes`, `indexOf`, `isArguments`, `isArray`, `isBoolean`,
5656
* `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`,
57-
* `isFunction`, `isMatch` , `isNative`, `isNaN`, `isNull`, `isNumber`,
57+
* `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
5858
* `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
5959
* `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`,
6060
* `noConflict`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`,
6161
* `random`, `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`,
6262
* `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`,
63-
* `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
64-
* `unescape`, `uniqueId`, `value`, and `words`
63+
* `startCase`, `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`,
64+
* `trunc`, `unescape`, `uniqueId`, `value`, and `words`
6565
*
6666
* The wrapper function `sample` will return a wrapped value when `n` is provided,
6767
* otherwise an unwrapped value is returned.

collection/findWhere.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define(['./find', '../utility/matches'], function(find, matches) {
1+
define(['../internal/baseMatches', './find'], function(baseMatches, find) {
22

33
/**
44
* Performs a deep comparison between each element in `collection` and the
@@ -25,7 +25,7 @@ define(['./find', '../utility/matches'], function(find, matches) {
2525
* // => 'fred'
2626
*/
2727
function findWhere(collection, source) {
28-
return find(collection, matches(source));
28+
return find(collection, baseMatches(source));
2929
}
3030

3131
return findWhere;

collection/pluck.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define(['./map', '../utility/property'], function(map, property) {
1+
define(['../internal/baseProperty', './map'], function(baseProperty, map) {
22

33
/**
44
* Gets the value of `key` from all elements in `collection`.
@@ -24,7 +24,7 @@ define(['./map', '../utility/property'], function(map, property) {
2424
* // => [36, 40] (iteration order is not guaranteed)
2525
*/
2626
function pluck(collection, key) {
27-
return map(collection, property(key));
27+
return map(collection, baseProperty(key + ''));
2828
}
2929

3030
return pluck;

collection/where.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define(['./filter', '../utility/matches'], function(filter, matches) {
1+
define(['../internal/baseMatches', './filter'], function(baseMatches, filter) {
22

33
/**
44
* Performs a deep comparison between each element in `collection` and the
@@ -28,7 +28,7 @@ define(['./filter', '../utility/matches'], function(filter, matches) {
2828
* // => ['barney', 'fred']
2929
*/
3030
function where(collection, source) {
31-
return filter(collection, matches(source));
31+
return filter(collection, baseMatches(source));
3232
}
3333

3434
return where;

internal/baseCallback.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ define(['./baseMatches', './baseProperty', './bindCallback', '../utility/identit
2222
}
2323
// Handle "_.property" and "_.matches" style callback shorthands.
2424
return type == 'object'
25-
? baseMatches(func, !argCount)
25+
? baseMatches(func)
2626
: baseProperty(func + '');
2727
}
2828

internal/baseMatches.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define(['./baseClone', './baseIsMatch', './isStrictComparable', '../object/keys'], function(baseClone, baseIsMatch, isStrictComparable, keys) {
1+
define(['./baseIsMatch', './isStrictComparable', '../object/keys'], function(baseIsMatch, isStrictComparable, keys) {
22

33
/** Used for native method references. */
44
var objectProto = Object.prototype;
@@ -12,10 +12,9 @@ define(['./baseClone', './baseIsMatch', './isStrictComparable', '../object/keys'
1212
*
1313
* @private
1414
* @param {Object} source The object of property values to match.
15-
* @param {boolean} [isCloned] Specify cloning the source object.
1615
* @returns {Function} Returns the new function.
1716
*/
18-
function baseMatches(source, isCloned) {
17+
function baseMatches(source) {
1918
var props = keys(source),
2019
length = props.length;
2120

@@ -29,9 +28,6 @@ define(['./baseClone', './baseIsMatch', './isStrictComparable', '../object/keys'
2928
};
3029
}
3130
}
32-
if (isCloned) {
33-
source = baseClone(source, true);
34-
}
3531
var values = Array(length),
3632
strictCompareFlags = Array(length);
3733

internal/isIndex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ define([], function() {
22

33
/**
44
* Used as the maximum length of an array-like value.
5-
* See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
5+
* See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
66
* for more details.
77
*/
88
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;

internal/isIterateeCall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ define(['./isIndex', './isLength', '../lang/isObject'], function(isIndex, isLeng
1818
var length = object.length,
1919
prereq = isLength(length) && isIndex(index, length);
2020
} else {
21-
prereq = type == 'string' && index in value;
21+
prereq = type == 'string' && index in object;
2222
}
2323
return prereq && object[index] === value;
2424
}

internal/isLength.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ define([], function() {
22

33
/**
44
* Used as the maximum length of an array-like value.
5-
* See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
5+
* See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
66
* for more details.
77
*/
88
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
99

1010
/**
1111
* Checks if `value` is a valid array-like length.
1212
*
13+
* **Note:** This function is based on ES `ToLength`. See the
14+
* [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
15+
* for more details.
16+
*
1317
* @private
1418
* @param {*} value The value to check.
1519
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.

0 commit comments

Comments
 (0)
0