mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Bump to v3.3.0.
This commit is contained in:
@@ -19,7 +19,9 @@ define(['./lodash'], function(lodash) {
|
||||
*
|
||||
* var youngest = _.chain(users)
|
||||
* .sortBy('age')
|
||||
* .map(function(chr) { return chr.user + ' is ' + chr.age; })
|
||||
* .map(function(chr) {
|
||||
* return chr.user + ' is ' + chr.age;
|
||||
* })
|
||||
* .first()
|
||||
* .value();
|
||||
* // => 'pebbles is 1'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../internal/LazyWrapper', '../internal/LodashWrapper', '../lang/isArray', '../internal/isObjectLike', '../internal/wrapperClone'], function(LazyWrapper, LodashWrapper, isArray, isObjectLike, wrapperClone) {
|
||||
define(['../internal/LazyWrapper', '../internal/LodashWrapper', '../internal/baseLodash', '../lang/isArray', '../internal/isObjectLike', '../internal/wrapperClone'], function(LazyWrapper, LodashWrapper, baseLodash, isArray, isObjectLike, wrapperClone) {
|
||||
|
||||
/** Used for native method references. */
|
||||
var objectProto = Object.prototype;
|
||||
@@ -78,11 +78,15 @@ define(['../internal/LazyWrapper', '../internal/LodashWrapper', '../lang/isArray
|
||||
* var wrapped = _([1, 2, 3]);
|
||||
*
|
||||
* // returns an unwrapped value
|
||||
* wrapped.reduce(function(sum, n) { return sum + n; });
|
||||
* wrapped.reduce(function(sum, n) {
|
||||
* return sum + n;
|
||||
* });
|
||||
* // => 6
|
||||
*
|
||||
* // returns a wrapped value
|
||||
* var squares = wrapped.map(function(n) { return n * n; });
|
||||
* var squares = wrapped.map(function(n) {
|
||||
* return n * n;
|
||||
* });
|
||||
*
|
||||
* _.isArray(squares);
|
||||
* // => false
|
||||
@@ -102,5 +106,8 @@ define(['../internal/LazyWrapper', '../internal/LodashWrapper', '../lang/isArray
|
||||
return new LodashWrapper(value);
|
||||
}
|
||||
|
||||
// Ensure wrappers are instances of `baseLodash`.
|
||||
lodash.prototype = baseLodash.prototype;
|
||||
|
||||
return lodash;
|
||||
});
|
||||
|
||||
@@ -16,7 +16,9 @@ define([], function() {
|
||||
* @example
|
||||
*
|
||||
* _([1, 2, 3])
|
||||
* .tap(function(array) { array.pop(); })
|
||||
* .tap(function(array) {
|
||||
* array.pop();
|
||||
* })
|
||||
* .reverse()
|
||||
* .value();
|
||||
* // => [2, 1]
|
||||
|
||||
@@ -14,7 +14,9 @@ define([], function() {
|
||||
*
|
||||
* _([1, 2, 3])
|
||||
* .last()
|
||||
* .thru(function(value) { return [value]; })
|
||||
* .thru(function(value) {
|
||||
* return [value];
|
||||
* })
|
||||
* .value();
|
||||
* // => [3]
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../internal/LodashWrapper', '../internal/wrapperClone'], function(LodashWrapper, wrapperClone) {
|
||||
define(['../internal/baseLodash', '../internal/wrapperClone'], function(baseLodash, wrapperClone) {
|
||||
|
||||
/**
|
||||
* Creates a clone of the chained sequence planting `value` as the wrapped value.
|
||||
@@ -27,7 +27,7 @@ define(['../internal/LodashWrapper', '../internal/wrapperClone'], function(Lodas
|
||||
var result,
|
||||
parent = this;
|
||||
|
||||
while (parent instanceof LodashWrapper) {
|
||||
while (parent instanceof baseLodash) {
|
||||
var clone = wrapperClone(parent);
|
||||
if (result) {
|
||||
previous.__wrapped__ = clone;
|
||||
|
||||
Reference in New Issue
Block a user