Bump to v4.6.0.

This commit is contained in:
John-David Dalton
2016-02-29 23:41:02 -08:00
parent 9055c4e483
commit 7da4c55415
65 changed files with 413 additions and 235 deletions

View File

@@ -1,7 +1,13 @@
import assignValue from './_assignValue';
import copyObject from './_copyObject';
import createAssigner from './_createAssigner';
import isArrayLike from './isArrayLike';
import isPrototype from './_isPrototype';
import keysIn from './keysIn';
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
var nonEnumShadows = !({ 'valueOf': 1 }).propertyIsEnumerable('valueOf');
/**
* This method is like `_.assign` except that it iterates over own and
* inherited source properties.
@@ -32,7 +38,13 @@ import keysIn from './keysIn';
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
*/
var assignIn = createAssigner(function(object, source) {
copyObject(source, keysIn(source), object);
if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
copyObject(source, keysIn(source), object);
return;
}
for (var key in source) {
assignValue(object, key, source[key]);
}
});
export default assignIn;