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

Skip to content

Commit cc16e11

Browse files
committed
Bump to v3.3.1.
1 parent 5dc85cc commit cc16e11

13 files changed

+53
-45
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# lodash v3.3.0
1+
# lodash v3.3.1
22

33
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules.
44

@@ -28,7 +28,7 @@ var array = require('lodash/array');
2828
var chunk = require('lodash/array/chunk');
2929
```
3030

31-
See the [package source](https://github.com/lodash/lodash/tree/3.3.0-npm) for more details.
31+
See the [package source](https://github.com/lodash/lodash/tree/3.3.1-npm) for more details.
3232

3333
**Note:**<br>
3434
Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>
@@ -39,8 +39,8 @@ Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash b
3939
lodash is also available in a variety of other builds & module formats.
4040

4141
* npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds
42-
* AMD modules for [modern](https://github.com/lodash/lodash/tree/3.3.0-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.3.0-amd) builds
43-
* ES modules for the [modern](https://github.com/lodash/lodash/tree/3.3.0-es) build
42+
* AMD modules for [modern](https://github.com/lodash/lodash/tree/3.3.1-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.3.1-amd) builds
43+
* ES modules for the [modern](https://github.com/lodash/lodash/tree/3.3.1-es) build
4444

4545
## Further Reading
4646

@@ -74,7 +74,6 @@ lodash is also available in a variety of other builds & module formats.
7474
* [_.forEach](https://lodash.com/docs#forEach) supports exiting early
7575
* [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties
7676
* [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties
77-
* [_.includes](https://lodash.com/docs#includes) accepts a `fromIndex`
7877
* [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range
7978
* [_.isNative](https://lodash.com/docs#isNative) to check for native functions
8079
* [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects
@@ -111,6 +110,6 @@ lodash is also available in a variety of other builds & module formats.
111110

112111
## Support
113112

114-
Tested in Chrome 39-40, Firefox 34-35, IE 6-11, Opera 26-27, Safari 5-8, io.js 1.2.0, Node.js 0.8.28, 0.10.36, & 0.12.0, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7RC5.
113+
Tested in Chrome 39-40, Firefox 34-35, IE 6-11, Opera 26-27, Safari 5-8, io.js 1.3.0, Node.js 0.8.28, 0.10.36, & 0.12.0, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7RC5.
115114

116115
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.

array/findLastIndex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var baseCallback = require('../internal/baseCallback');
3737
* // => 2
3838
*
3939
* // using the `_.matches` callback shorthand
40-
* _.findLastIndex(users, { user': 'barney', 'active': true });
40+
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
4141
* // => 0
4242
*
4343
* // using the `_.matchesProperty` callback shorthand

array/indexOf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var nativeMax = Math.max;
2626
* @example
2727
*
2828
* _.indexOf([1, 2, 1, 2], 2);
29-
* // => 2
29+
* // => 1
3030
*
3131
* // using `fromIndex`
3232
* _.indexOf([1, 2, 1, 2], 2, 2);

array/intersection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function intersection() {
3434
var value = arguments[argsIndex];
3535
if (isArray(value) || isArguments(value)) {
3636
args.push(value);
37-
caches.push(isCommon && value.length >= 120 && createCache(argsIndex && value));
37+
caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null);
3838
}
3939
}
4040
argsLength = args.length;

collection/some.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var arraySome = require('../internal/arraySome'),
4141
* ];
4242
*
4343
* // using the `_.matches` callback shorthand
44-
* _.some(users, { user': 'barney', 'active': false });
44+
* _.some(users, { 'user': 'barney', 'active': false });
4545
* // => false
4646
*
4747
* // using the `_.matchesProperty` callback shorthand

function/debounce.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var nativeMax = Math.max;
2626
* @memberOf _
2727
* @category Function
2828
* @param {Function} func The function to debounce.
29-
* @param {number} wait The number of milliseconds to delay.
29+
* @param {number} [wait=0] The number of milliseconds to delay.
3030
* @param {Object} [options] The options object.
3131
* @param {boolean} [options.leading=false] Specify invoking on the leading
3232
* edge of the timeout.
@@ -84,7 +84,7 @@ function debounce(func, wait, options) {
8484
if (typeof func != 'function') {
8585
throw new TypeError(FUNC_ERROR_TEXT);
8686
}
87-
wait = wait < 0 ? 0 : wait;
87+
wait = wait < 0 ? 0 : (+wait || 0);
8888
if (options === true) {
8989
var leading = true;
9090
trailing = false;

function/throttle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var debounceOptions = {
3030
* @memberOf _
3131
* @category Function
3232
* @param {Function} func The function to throttle.
33-
* @param {number} wait The number of milliseconds to throttle invocations to.
33+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
3434
* @param {Object} [options] The options object.
3535
* @param {boolean} [options.leading=true] Specify invoking on the leading
3636
* edge of the timeout.

index.js

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* @license
3-
* lodash 3.3.0 (Custom Build) <https://lodash.com/>
3+
* lodash 3.3.1 (Custom Build) <https://lodash.com/>
44
* Build: `lodash modern -d -o ./index.js`
55
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
6-
* Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
6+
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE>
77
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
88
* Available under MIT license <https://lodash.com/license>
99
*/
@@ -13,7 +13,7 @@
1313
var undefined;
1414

1515
/** Used as the semantic version number. */
16-
var VERSION = '3.3.0';
16+
var VERSION = '3.3.1';
1717

1818
/** Used to compose bitmasks for wrapper metadata. */
1919
var BIND_FLAG = 1,
@@ -1804,7 +1804,7 @@
18041804
var index = -1,
18051805
indexOf = getIndexOf(),
18061806
isCommon = indexOf == baseIndexOf,
1807-
cache = isCommon && values.length >= 200 && createCache(values),
1807+
cache = (isCommon && values.length >= 200) ? createCache(values) : null,
18081808
valuesLength = values.length;
18091809

18101810
if (cache) {
@@ -2624,7 +2624,7 @@
26242624
length = array.length,
26252625
isCommon = indexOf == baseIndexOf,
26262626
isLarge = isCommon && length >= 200,
2627-
seen = isLarge && createCache(),
2627+
seen = isLarge ? createCache() : null,
26282628
result = [];
26292629

26302630
if (seen) {
@@ -3676,8 +3676,11 @@
36763676
} else {
36773677
prereq = type == 'string' && index in object;
36783678
}
3679-
var other = object[index];
3680-
return prereq && (value === value ? value === other : other !== other);
3679+
if (prereq) {
3680+
var other = object[index];
3681+
return value === value ? value === other : other !== other;
3682+
}
3683+
return false;
36813684
}
36823685

36833686
/**
@@ -4403,7 +4406,7 @@
44034406
* // => 2
44044407
*
44054408
* // using the `_.matches` callback shorthand
4406-
* _.findLastIndex(users, { user': 'barney', 'active': true });
4409+
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
44074410
* // => 0
44084411
*
44094412
* // using the `_.matchesProperty` callback shorthand
@@ -4514,7 +4517,7 @@
45144517
* @example
45154518
*
45164519
* _.indexOf([1, 2, 1, 2], 2);
4517-
* // => 2
4520+
* // => 1
45184521
*
45194522
* // using `fromIndex`
45204523
* _.indexOf([1, 2, 1, 2], 2, 2);
@@ -4587,7 +4590,7 @@
45874590
var value = arguments[argsIndex];
45884591
if (isArray(value) || isArguments(value)) {
45894592
args.push(value);
4590-
caches.push(isCommon && value.length >= 120 && createCache(argsIndex && value));
4593+
caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null);
45914594
}
45924595
}
45934596
argsLength = args.length;
@@ -6655,7 +6658,7 @@
66556658
* ];
66566659
*
66576660
* // using the `_.matches` callback shorthand
6658-
* _.some(users, { user': 'barney', 'active': false });
6661+
* _.some(users, { 'user': 'barney', 'active': false });
66596662
* // => false
66606663
*
66616664
* // using the `_.matchesProperty` callback shorthand
@@ -7191,7 +7194,7 @@
71917194
* @memberOf _
71927195
* @category Function
71937196
* @param {Function} func The function to debounce.
7194-
* @param {number} wait The number of milliseconds to delay.
7197+
* @param {number} [wait=0] The number of milliseconds to delay.
71957198
* @param {Object} [options] The options object.
71967199
* @param {boolean} [options.leading=false] Specify invoking on the leading
71977200
* edge of the timeout.
@@ -7249,7 +7252,7 @@
72497252
if (typeof func != 'function') {
72507253
throw new TypeError(FUNC_ERROR_TEXT);
72517254
}
7252-
wait = wait < 0 ? 0 : wait;
7255+
wait = wait < 0 ? 0 : (+wait || 0);
72537256
if (options === true) {
72547257
var leading = true;
72557258
trailing = false;
@@ -7770,7 +7773,7 @@
77707773
* @memberOf _
77717774
* @category Function
77727775
* @param {Function} func The function to throttle.
7773-
* @param {number} wait The number of milliseconds to throttle invocations to.
7776+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
77747777
* @param {Object} [options] The options object.
77757778
* @param {boolean} [options.leading=true] Specify invoking on the leading
77767779
* edge of the timeout.
@@ -10087,10 +10090,10 @@
1008710090
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
1008810091
* compiled.source;
1008910092
* // => function(data) {
10090-
* var __t, __p = '';
10091-
* __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
10092-
* return __p;
10093-
* }
10093+
* // var __t, __p = '';
10094+
* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
10095+
* // return __p;
10096+
* // }
1009410097
*
1009510098
* // using the `source` property to inline compiled templates for meaningful
1009610099
* // line numbers in error messages and a stack trace
@@ -11204,15 +11207,13 @@
1120411207

1120511208
// Add `LazyWrapper` methods that accept an `iteratee` value.
1120611209
arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
11207-
var isFilter = index == LAZY_FILTER_FLAG,
11208-
isWhile = index == LAZY_WHILE_FLAG;
11210+
var isFilter = index == LAZY_FILTER_FLAG || index == LAZY_WHILE_FLAG;
1120911211

1121011212
LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
1121111213
var result = this.clone(),
11212-
filtered = result.__filtered__,
1121311214
iteratees = result.__iteratees__ || (result.__iteratees__ = []);
1121411215

11215-
result.__filtered__ = filtered || isFilter || (isWhile && result.__dir__ < 0);
11216+
result.__filtered__ = result.__filtered__ || isFilter;
1121611217
iteratees.push({ 'iteratee': getCallback(iteratee, thisArg, 3), 'type': index });
1121711218
return result;
1121811219
};
@@ -11279,9 +11280,14 @@
1127911280
};
1128011281

1128111282
LazyWrapper.prototype.dropWhile = function(predicate, thisArg) {
11282-
var done;
11283+
var done,
11284+
lastIndex,
11285+
isRight = this.__dir__ < 0;
11286+
1128311287
predicate = getCallback(predicate, thisArg, 3);
1128411288
return this.filter(function(value, index, array) {
11289+
done = done && (isRight ? index < lastIndex : index > lastIndex);
11290+
lastIndex = index;
1128511291
return done || (done = !predicate(value, index, array));
1128611292
});
1128711293
};

internal/baseDifference.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function baseDifference(array, values) {
2121
var index = -1,
2222
indexOf = baseIndexOf,
2323
isCommon = true,
24-
cache = isCommon && values.length >= 200 && createCache(values),
24+
cache = (isCommon && values.length >= 200) ? createCache(values) : null,
2525
valuesLength = values.length;
2626

2727
if (cache) {

internal/baseUniq.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function baseUniq(array, iteratee) {
1717
length = array.length,
1818
isCommon = true,
1919
isLarge = isCommon && length >= 200,
20-
seen = isLarge && createCache(),
20+
seen = isLarge ? createCache() : null,
2121
result = [];
2222

2323
if (seen) {

internal/isIterateeCall.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ function isIterateeCall(value, index, object) {
2222
} else {
2323
prereq = type == 'string' && index in object;
2424
}
25-
var other = object[index];
26-
return prereq && (value === value ? value === other : other !== other);
25+
if (prereq) {
26+
var other = object[index];
27+
return value === value ? value === other : other !== other;
28+
}
29+
return false;
2730
}
2831

2932
module.exports = isIterateeCall;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lodash",
3-
"version": "3.3.0",
3+
"version": "3.3.1 B8A6 ",
44
"description": "The modern build of lodash modular utilities.",
55
"homepage": "https://lodash.com/",
66
"icon": "https://lodash.com/icon.svg",

string/template.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
111111
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
112112
* compiled.source;
113113
* // => function(data) {
114-
* var __t, __p = '';
115-
* __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
116-
* return __p;
117-
* }
114+
* // var __t, __p = '';
115+
* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
116+
* // return __p;
117+
* // }
118118
*
119119
* // using the `source` property to inline compiled templates for meaningful
120120
* // line numbers in error messages and a stack trace

0 commit comments

Comments
 (0)
0