Bump to v4.1.0.

This commit is contained in:
John-David Dalton
2016-01-28 01:19:04 -08:00
parent 7af5d55f22
commit 466c67a8b6
438 changed files with 1053 additions and 896 deletions

22
_baseUnset.js Normal file
View File

@@ -0,0 +1,22 @@
import baseToPath from './_baseToPath';
import has from './has';
import isKey from './_isKey';
import last from './last';
import parent from './_parent';
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = isKey(path, object) ? [path + ''] : baseToPath(path);
object = parent(object, path);
var key = last(path);
return (object != null && has(object, key)) ? delete object[key] : true;
}
export default baseUnset;