Bump to v3.6.0.

This commit is contained in:
jdalton
2015-03-24 16:44:49 -07:00
parent 06f6ffa303
commit d58549ce0b
192 changed files with 2218 additions and 1804 deletions

View File

@@ -5,7 +5,7 @@ var baseAssign = require('../internal/baseAssign'),
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources overwrite property assignments of previous sources.
* If `customizer` is provided it is invoked to produce the assigned values.
* The `customizer` is bound to `thisArg` and invoked with five arguments;
* The `customizer` is bound to `thisArg` and invoked with five arguments:
* (objectValue, sourceValue, key, object, source).
*
* @static

View File

@@ -1,6 +1,6 @@
var arrayCopy = require('../internal/arrayCopy'),
assign = require('./assign'),
assignDefaults = require('../internal/assignDefaults');
var assign = require('./assign'),
assignDefaults = require('../internal/assignDefaults'),
restParam = require('../function/restParam');
/**
* Assigns own enumerable properties of source object(s) to the destination
@@ -18,13 +18,13 @@ var arrayCopy = require('../internal/arrayCopy'),
* _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
* // => { 'user': 'barney', 'age': 36 }
*/
function defaults(object) {
var defaults = restParam(function(args) {
var object = args[0];
if (object == null) {
return object;
}
var args = arrayCopy(arguments);
args.push(assignDefaults);
return assign.apply(undefined, args);
}
});
module.exports = defaults;

View File

@@ -1,10 +1,9 @@
var baseCallback = require('../internal/baseCallback'),
baseFind = require('../internal/baseFind'),
baseForOwn = require('../internal/baseForOwn');
var baseForOwn = require('../internal/baseForOwn'),
createFindKey = require('../internal/createFindKey');
/**
* This method is like `_.findIndex` except that it returns the key of the
* first element `predicate` returns truthy for, instead of the element itself.
* This method is like `_.find` except that it returns the key of the first
* element `predicate` returns truthy for instead of the element itself.
*
* If a property name is provided for `predicate` the created `_.property`
* style callback returns the property value of the given element.
@@ -50,9 +49,6 @@ var baseCallback = require('../internal/baseCallback'),
* _.findKey(users, 'active');
* // => 'barney'
*/
function findKey(object, predicate, thisArg) {
predicate = baseCallback(predicate, thisArg, 3);
return baseFind(object, predicate, baseForOwn, true);
}
var findKey = createFindKey(baseForOwn);
module.exports = findKey;

View File

@@ -1,6 +1,5 @@
var baseCallback = require('../internal/baseCallback'),
baseFind = require('../internal/baseFind'),
baseForOwnRight = require('../internal/baseForOwnRight');
var baseForOwnRight = require('../internal/baseForOwnRight'),
createFindKey = require('../internal/createFindKey');
/**
* This method is like `_.findKey` except that it iterates over elements of
@@ -50,9 +49,6 @@ var baseCallback = require('../internal/baseCallback'),
* _.findLastKey(users, 'active');
* // => 'pebbles'
*/
function findLastKey(object, predicate, thisArg) {
predicate = baseCallback(predicate, thisArg, 3);
return baseFind(object, predicate, baseForOwnRight, true);
}
var findLastKey = createFindKey(baseForOwnRight);
module.exports = findLastKey;

View File

@@ -1,11 +1,10 @@
var baseFor = require('../internal/baseFor'),
bindCallback = require('../internal/bindCallback'),
keysIn = require('./keysIn');
createForIn = require('../internal/createForIn');
/**
* Iterates over own and inherited enumerable properties of an object invoking
* `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
* with three arguments; (value, key, object). Iterator functions may exit
* with three arguments: (value, key, object). Iterator functions may exit
* iteration early by explicitly returning `false`.
*
* @static
@@ -29,11 +28,6 @@ var baseFor = require('../internal/baseFor'),
* });
* // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)
*/
function forIn(object, iteratee, thisArg) {
if (typeof iteratee != 'function' || typeof thisArg != 'undefined') {
iteratee = bindCallback(iteratee, thisArg, 3);
}
return baseFor(object, iteratee, keysIn);
}
var forIn = createForIn(baseFor);
module.exports = forIn;

View File

@@ -1,6 +1,5 @@
var baseForRight = require('../internal/baseForRight'),
bindCallback = require('../internal/bindCallback'),
keysIn = require('./keysIn');
createForIn = require('../internal/createForIn');
/**
* This method is like `_.forIn` except that it iterates over properties of
@@ -27,9 +26,6 @@ var baseForRight = require('../internal/baseForRight'),
* });
* // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
*/
function forInRight(object, iteratee, thisArg) {
iteratee = bindCallback(iteratee, thisArg, 3);
return baseForRight(object, iteratee, keysIn);
}
var forInRight = createForIn(baseForRight);
module.exports = forInRight;

View File

@@ -1,10 +1,10 @@
var baseForOwn = require('../internal/baseForOwn'),
bindCallback = require('../internal/bindCallback');
createForOwn = require('../internal/createForOwn');
/**
* Iterates over own enumerable properties of an object invoking `iteratee`
* for each property. The `iteratee` is bound to `thisArg` and invoked with
* three arguments; (value, key, object). Iterator functions may exit iteration
* three arguments: (value, key, object). Iterator functions may exit iteration
* early by explicitly returning `false`.
*
* @static
@@ -28,11 +28,6 @@ var baseForOwn = require('../internal/baseForOwn'),
* });
* // => logs 'a' and 'b' (iteration order is not guaranteed)
*/
function forOwn(object, iteratee, thisArg) {
if (typeof iteratee != 'function' || typeof thisArg != 'undefined') {
iteratee = bindCallback(iteratee, thisArg, 3);
}
return baseForOwn(object, iteratee);
}
var forOwn = createForOwn(baseForOwn);
module.exports = forOwn;

View File

@@ -1,6 +1,5 @@
var baseForRight = require('../internal/baseForRight'),
bindCallback = require('../internal/bindCallback'),
keys = require('./keys');
var baseForOwnRight = require('../internal/baseForOwnRight'),
createForOwn = require('../internal/createForOwn');
/**
* This method is like `_.forOwn` except that it iterates over properties of
@@ -27,9 +26,6 @@ var baseForRight = require('../internal/baseForRight'),
* });
* // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
*/
function forOwnRight(object, iteratee, thisArg) {
iteratee = bindCallback(iteratee, thisArg, 3);
return baseForRight(object, iteratee, keys);
}
var forOwnRight = createForOwn(baseForOwnRight);
module.exports = forOwnRight;

View File

@@ -4,7 +4,7 @@ var baseCallback = require('../internal/baseCallback'),
/**
* Creates an object with the same keys as `object` and values generated by
* running each own enumerable property of `object` through `iteratee`. The
* iteratee function is bound to `thisArg` and invoked with three arguments;
* iteratee function is bound to `thisArg` and invoked with three arguments:
* (value, key, object).
*
* If a property name is provided for `iteratee` the created `_.property`

View File

@@ -8,7 +8,7 @@ var baseMerge = require('../internal/baseMerge'),
* provided it is invoked to produce the merged values of the destination and
* source properties. If `customizer` returns `undefined` merging is handled
* by the method instead. The `customizer` is bound to `thisArg` and invoked
* with five arguments; (objectValue, sourceValue, key, object, source).
* with five arguments: (objectValue, sourceValue, key, object, source).
*
* @static
* @memberOf _

View File

@@ -4,7 +4,8 @@ var arrayMap = require('../internal/arrayMap'),
bindCallback = require('../internal/bindCallback'),
keysIn = require('./keysIn'),
pickByArray = require('../internal/pickByArray'),
pickByCallback = require('../internal/pickByCallback');
pickByCallback = require('../internal/pickByCallback'),
restParam = require('../function/restParam');
/**
* The opposite of `_.pick`; this method creates an object composed of the
@@ -12,7 +13,7 @@ var arrayMap = require('../internal/arrayMap'),
* Property names may be specified as individual arguments or as arrays of
* property names. If `predicate` is provided it is invoked for each property
* of `object` omitting the properties `predicate` returns truthy for. The
* predicate is bound to `thisArg` and invoked with three arguments;
* predicate is bound to `thisArg` and invoked with three arguments:
* (value, key, object).
*
* @static
@@ -34,18 +35,18 @@ var arrayMap = require('../internal/arrayMap'),
* _.omit(object, _.isNumber);
* // => { 'user': 'fred' }
*/
function omit(object, predicate, thisArg) {
var omit = restParam(function(object, props) {
if (object == null) {
return {};
}
if (typeof predicate != 'function') {
var props = arrayMap(baseFlatten(arguments, false, false, 1), String);
if (typeof props[0] != 'function') {
var props = arrayMap(baseFlatten(props), String);
return pickByArray(object, baseDifference(keysIn(object), props));
}
predicate = bindCallback(predicate, thisArg, 3);
var predicate = bindCallback(props[0], props[1], 3);
return pickByCallback(object, function(value, key, object) {
return !predicate(value, key, object);
});
}
});
module.exports = omit;

View File

@@ -1,14 +1,15 @@
var baseFlatten = require('../internal/baseFlatten'),
bindCallback = require('../internal/bindCallback'),
pickByArray = require('../internal/pickByArray'),
pickByCallback = require('../internal/pickByCallback');
pickByCallback = require('../internal/pickByCallback'),
restParam = require('../function/restParam');
/**
* Creates an object composed of the picked `object` properties. Property
* names may be specified as individual arguments or as arrays of property
* names. If `predicate` is provided it is invoked for each property of `object`
* picking the properties `predicate` returns truthy for. The predicate is
* bound to `thisArg` and invoked with three arguments; (value, key, object).
* bound to `thisArg` and invoked with three arguments: (value, key, object).
*
* @static
* @memberOf _
@@ -29,13 +30,13 @@ var baseFlatten = require('../internal/baseFlatten'),
* _.pick(object, _.isString);
* // => { 'user': 'fred' }
*/
function pick(object, predicate, thisArg) {
var pick = restParam(function(object, props) {
if (object == null) {
return {};
}
return typeof predicate == 'function'
? pickByCallback(object, bindCallback(predicate, thisArg, 3))
: pickByArray(object, baseFlatten(arguments, false, false, 1));
}
return typeof props[0] == 'function'
? pickByCallback(object, bindCallback(props[0], props[1], 3))
: pickByArray(object, baseFlatten(props));
});
module.exports = pick;

View File

@@ -12,7 +12,7 @@ var arrayEach = require('../internal/arrayEach'),
* `accumulator` object which is the result of running each of its own enumerable
* properties through `iteratee`, with each invocation potentially mutating
* the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked
* with four arguments; (accumulator, value, key, object). Iterator functions
* with four arguments: (accumulator, value, key, object). Iterator functions
* may exit iteration early by explicitly returning `false`.
*
* @static