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

Skip to content

Commit 7a82a3d

Browse files
committed
Bump to v3.3.1.
1 parent f8e4370 commit 7a82a3d

File tree

13 files changed

+49
-40
lines changed

13 files changed

+49
-40
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.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 [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
44

array/findLastIndex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ define(['../internal/baseCallback'], function(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
@@ -25,7 +25,7 @@ define(['../internal/baseIndexOf', '../internal/binaryIndex'], function(baseInde
2525
* @example
2626
*
2727
* _.indexOf([1, 2, 1, 2], 2);
28-
* // => 2
28+
* // => 1
2929
*
3030
* // using `fromIndex`
3131
* _.indexOf([1, 2, 1, 2], 2, 2);

array/intersection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ define(['../internal/baseIndexOf', '../internal/cacheIndexOf', '../internal/crea
3030
var value = arguments[argsIndex];
3131
if (isArray(value) || isArguments(value)) {
3232
args.push(value);
33-
caches.push(isCommon && value.length >= 120 && createCache(argsIndex && value));
33+
caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null);
3434
}
3535
}
3636
argsLength = args.length;

collection/some.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ define(['../internal/arraySome', '../internal/baseCallback', '../internal/baseSo
3838
* ];
3939
*
4040
* // using the `_.matches` callback shorthand
41-
* _.some(users, { user': 'barney', 'active': false });
41+
* _.some(users, { 'user': 'barney', 'active': false });
4242
* // => false
4343
*
4444
* // using the `_.matchesProperty` callback shorthand

function/debounce.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ define(['../lang/isObject', '../date/now'], function(isObject, now) {
2828
* @memberOf _
2929
* @category Function
3030
* @param {Function} func The function to debounce.
31-
* @param {number} wait The number of milliseconds to delay.
31+
* @param {number} [wait=0] The number of milliseconds to delay.
3232
* @param {Object} [options] The options object.
3333
* @param {boolean} [options.leading=false] Specify invoking on the leading
3434
* edge of the timeout.
@@ -86,7 +86,7 @@ define(['../lang/isObject', '../date/now'], function(isObject, now) {
8686
if (typeof func != 'function') {
8787
throw new TypeError(FUNC_ERROR_TEXT);
8888
}
89-
wait = wait < 0 ? 0 : wait;
89+
wait = wait < 0 ? 0 : (+wait || 0);
9090
if (options === true) {
9191
var leading = true;
9292
trailing = false;

function/throttle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ define(['./debounce', '../lang/isObject'], function(debounce, isObject) {
2929
* @memberOf _
3030
* @category Function
3131
* @param {Function} func The function to throttle.
32-
* @param {number} wait The number of milliseconds to throttle invocations to.
32+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
3333
* @param {Object} [options] The options object.
3434
* @param {boolean} [options.leading=true] Specify invoking on the leading
3535
* edge of the timeout.

internal/baseDifference.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ define(['./baseIndexOf', './cacheIndexOf', './createCache'], function(baseIndexO
1919
var index = -1,
2020
indexOf = baseIndexOf,
2121
isCommon = true,
22-
cache = isCommon && values.length >= 200 && createCache(values),
22+
cache = (isCommon && values.length >= 200) ? createCache(values) : null,
2323
valuesLength = values.length;
2424

2525
if (cache) {

internal/baseUniq.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ define(['./baseIndexOf', './cacheIndexOf', './createCache'], function(baseIndexO
1515
length = array.length,
1616
isCommon = true,
1717
isLarge = isCommon && length >= 200,
18-
seen = isLarge && createCache(),
18+
seen = isLarge ? createCache() : null,
1919
result = [];
2020

2121
if (seen) {

internal/isIterateeCall.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ define(['./isIndex', './isLength', '../lang/isObject'], function(isIndex, isLeng
2020
} else {
2121
prereq = type == 'string' && index in object;
2222
}
23-
var other = object[index];
24-
return prereq && (value === value ? value === other : other !== other);
23+
if (prereq) {
24+
var other = object[index];
25+
return value === value ? value === other : other !== other;
26+
}
27+
return false;
2528
}
2629

2730
return isIterateeCall;

main.js

Lines changed: 29 additions & 23 deletions
< 10000 td data-grid-cell-id="diff-58417e0f781b6656949d37258c8b9052ed266e2eb7a5163cad7b0863e6b2916a-11208-11210-1" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">11210
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 exports="amd" -d -o ./main.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,
@@ -1801,7 +1801,7 @@
18011801
var index = -1,
18021802
indexOf = getIndexOf(),
18031803
isCommon = indexOf == baseIndexOf,
1804-
cache = isCommon && values.length >= 200 && createCache(values),
1804+
cache = (isCommon && values.length >= 200) ? createCache(values) : null,
18051805
valuesLength = values.length;
18061806

18071807
if (cache) {
@@ -2621,7 +2621,7 @@
26212621
length = array.length,
26222622
isCommon = indexOf == baseIndexOf,
26232623
isLarge = isCommon && length >= 200,
2624-
seen = isLarge && createCache(),
2624+
seen = isLarge ? createCache() : null,
26252625
result = [];
26262626

26272627
if (seen) {
@@ -3673,8 +3673,11 @@
36733673
} else {
36743674
prereq = type == 'string' && index in object;
36753675
}
3676-
var other = object[index];
3677-
return prereq && (value === value ? value === other : other !== other);
3676+
if (prereq) {
3677+
var other = object[index];
3678+
return value === value ? value === other : other !== other;
3679+
}
3680+
return false;
36783681
}
36793682

36803683
/**
@@ -4400,7 +4403,7 @@
44004403
* // => 2
44014404
*
44024405
* // using the `_.matches` callback shorthand
4403-
* _.findLastIndex(users, { user': 'barney', 'active': true });
4406+
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
44044407
* // => 0
44054408
*
44064409
* // using the `_.matchesProperty` callback shorthand
@@ -4511,7 +4514,7 @@
45114514
* @example
45124515
*
45134516
* _.indexOf([1, 2, 1, 2], 2);
4514-
* // => 2
4517+
* // => 1
45154518
*
45164519
* // using `fromIndex`
45174520
* _.indexOf([1, 2, 1, 2], 2, 2);
@@ -4584,7 +4587,7 @@
45844587
var value = arguments[argsIndex];
45854588
if (isArray(value) || isArguments(value)) {
45864589
args.push(value);
4587-
caches.push(isCommon && value.length >= 120 && createCache(argsIndex && value));
4590+
caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null);
45884591
}
45894592
}
45904593
argsLength = args.length;
@@ -6652,7 +6655,7 @@
66526655
* ];
66536656
*
66546657
* // using the `_.matches` callback shorthand
6655-
* _.some(users, { user': 'barney', 'active': false });
6658+
* _.some(users, { 'user': 'barney', 'active': false });
66566659
* // => false
66576660
*
66586661
* // using the `_.matchesProperty` callback shorthand
@@ -7188,7 +7191,7 @@
71887191
* @memberOf _
71897192
* @category Function
71907193
* @param {Function} func The function to debounce.
7191-
* @param {number} wait The number of milliseconds to delay.
7194+
* @param {number} [wait=0] The number of milliseconds to delay.
71927195
* @param {Object} [options] The options object.
71937196
* @param {boolean} [options.leading=false] Specify invoking on the leading
71947197
* edge of the timeout.
@@ -7246,7 +7249,7 @@
72467249
if (typeof func != 'function') {
72477250
throw new TypeError(FUNC_ERROR_TEXT);
72487251
}
7249-
wait = wait < 0 ? 0 : wait;
7252+
wait = wait < 0 ? 0 : (+wait || 0);
72507253
if (options === true) {
72517254
var leading = true;
72527255
trailing = false;
@@ -7767,7 +7770,7 @@
77677770
* @memberOf _
77687771
* @category Function
77697772
* @param {Function} func The function to throttle.
7770-
* @param {number} wait The number of milliseconds to throttle invocations to.
7773+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
77717774
* @param {Object} [options] The options object.
77727775
* @param {boolean} [options.leading=true] Specify invoking on the leading
77737776
* edge of the timeout.
@@ -10084,10 +10087,10 @@
1008410087
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
1008510088
* compiled.source;
1008610089
* // => function(data) {
10087-
* var __t, __p = '';
10088-
* __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
10089-
* return __p;
10090-
* }
10090+
* // var __t, __p = '';
10091+
* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
10092+
* // return __p;
10093+
* // }
1009110094
*
1009210095
* // using the `source` property to inline compiled templates for meaningful
1009310096
* // line numbers in error messages and a stack trace
@@ -11201,15 +11204,13 @@
1120111204

1120211205
// Add `LazyWrapper` methods that accept an `iteratee` value.
1120311206
arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
11204-
var isFilter = index == LAZY_FILTER_FLAG,
11205-
isWhile = index == LAZY_WHILE_FLAG;
11207+
var isFilter = index == LAZY_FILTER_FLAG || index == LAZY_WHILE_FLAG;
1120611208

1120711209
LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
11208
var result = this.clone(),
11209-
filtered = result.__filtered__,
1121011211
iteratees = result.__iteratees__ || (result.__iteratees__ = []);
1121111212

11212-
result.__filtered__ = filtered || isFilter || (isWhile && result.__dir__ < 0);
11213+
result.__filtered__ = result.__filtered__ || isFilter;
1121311214
iteratees.push({ 'iteratee': getCallback(iteratee, thisArg, 3), 'type': index });
1121411215
return result;
1121511216
};
@@ -11276,9 +11277,14 @@
1127611277
};
1127711278

1127811279
LazyWrapper.prototype.dropWhile = function(predicate, thisArg) {
11279-
var done;
11280+
var done,
11281+
lastIndex,
11282+
isRight = this.__dir__ < 0;
11283+
1128011284
predicate = getCallback(predicate, thisArg, 3);
1128111285
return this.filter(function(value, index, array) {
11286+
done = done && (isRight ? index < lastIndex : index > lastIndex);
11287+
lastIndex = index;
1128211288
return done || (done = !predicate(value, index, array));
1128311289
});
1128411290
};

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",
44
"main": "main.js",
55
"private": true,
66
"volo": {

string/template.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ define(['../internal/assignOwnDefaults', '../utility/attempt', '../internal/base
104104
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
105105
* compiled.source;
106106
* // => function(data) {
107-
* var __t, __p = '';
108-
* __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
109-
* return __p;
110-
* }
107+
* // var __t, __p = '';
108+
* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
109+
* // return __p;
110+
* // }
111111
*
112112
* // using the `source` property to inline compiled templates for meaningful
113113
* // line numbers in error messages and a stack trace

0 commit comments

Comments
 (0)
0