mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-14 04:37:50 +00:00
Add _.toPlainObject.
This commit is contained in:
committed by
jdalton
parent
d70b5a9886
commit
ae9ac3b439
@@ -6606,6 +6606,21 @@
|
|||||||
: arrayCopy(collection);
|
: arrayCopy(collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts `value` to a plain object.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @category Collection
|
||||||
|
* @param {*} value The value to convert.
|
||||||
|
* @returns {Object} Returns the converted object.
|
||||||
|
*/
|
||||||
|
function toPlainObject(value) {
|
||||||
|
return (isArray(value) || isArguments(value) || isTypedArray(value))
|
||||||
|
? arrayToObject(value)
|
||||||
|
: baseCopy(value, keysIn(value));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a deep comparison between each element in `collection` and the
|
* Performs a deep comparison between each element in `collection` and the
|
||||||
* source object, returning an array of all elements that have equivalent
|
* source object, returning an array of all elements that have equivalent
|
||||||
@@ -10624,6 +10639,7 @@
|
|||||||
lodash.thru = thru;
|
lodash.thru = thru;
|
||||||
lodash.times = times;
|
lodash.times = times;
|
||||||
lodash.toArray = toArray;
|
lodash.toArray = toArray;
|
||||||
|
lodash.toPlainObject = toPlainObject;
|
||||||
lodash.transform = transform;
|
lodash.transform = transform;
|
||||||
lodash.union = union;
|
lodash.union = union;
|
||||||
lodash.uniq = uniq;
|
lodash.uniq = uniq;
|
||||||
|
|||||||
Reference in New Issue
Block a user