mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Remove baseAssign modules.
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
import copyObject from './copyObject.js'
|
|
||||||
import keys from '../keys.js'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The base implementation of `assign` without support for multiple sources
|
|
||||||
* or `customizer` functions.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Object} object The destination object.
|
|
||||||
* @param {Object} source The source object.
|
|
||||||
* @returns {Object} Returns `object`.
|
|
||||||
*/
|
|
||||||
function baseAssign(object, source) {
|
|
||||||
return object && copyObject(source, keys(source), object)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default baseAssign
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import copyObject from './copyObject.js'
|
|
||||||
import keysIn from '../keysIn.js'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The base implementation of `assignIn` without support for multiple sources
|
|
||||||
* or `customizer` functions.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Object} object The destination object.
|
|
||||||
* @param {Object} source The source object.
|
|
||||||
* @returns {Object} Returns `object`.
|
|
||||||
*/
|
|
||||||
function baseAssignIn(object, source) {
|
|
||||||
return object && copyObject(source, keysIn(source), object)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default baseAssignIn
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import eq from '../eq.js'
|
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
|
||||||
const objectProto = Object.prototype
|
|
||||||
|
|
||||||
/** Used to check objects for own properties. */
|
|
||||||
const hasOwnProperty = objectProto.hasOwnProperty
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used by `defaults` to customize its `assignIn` use to assign properties
|
|
||||||
* of source objects to the destination object for all destination properties
|
|
||||||
* that resolve to `undefined`.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {*} objValue The destination value.
|
|
||||||
* @param {*} srcValue The source value.
|
|
||||||
* @param {string} key The key of the property to assign.
|
|
||||||
* @param {Object} object The parent object of `objValue`.
|
|
||||||
* @returns {*} Returns the value to assign.
|
|
||||||
*/
|
|
||||||
function customDefaultsAssignIn(objValue, srcValue, key, object) {
|
|
||||||
if (objValue === undefined ||
|
|
||||||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
|
|
||||||
return srcValue
|
|
||||||
}
|
|
||||||
return objValue
|
|
||||||
}
|
|
||||||
|
|
||||||
export default customDefaultsAssignIn
|
|
||||||
Reference in New Issue
Block a user