mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Simplify _.set for plain keys.
This commit is contained in:
@@ -9964,13 +9964,7 @@
|
||||
* // => 5
|
||||
*/
|
||||
function set(object, path, value) {
|
||||
if (isKey(path, object)) {
|
||||
if (isObject(object)) {
|
||||
object[path] = value;
|
||||
}
|
||||
return object;
|
||||
}
|
||||
path = toPath(path);
|
||||
path = isKey(path, object) ? [path] : toPath(path);
|
||||
|
||||
var index = -1,
|
||||
length = path.length,
|
||||
|
||||
Reference in New Issue
Block a user