mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
15 lines
304 B
JavaScript
15 lines
304 B
JavaScript
import isObject from '../lang/isObject';
|
|
|
|
/**
|
|
* Converts `value` to an object if it is not one.
|
|
*
|
|
* @private
|
|
* @param {*} value The value to process.
|
|
* @returns {Object} Returns the object.
|
|
*/
|
|
function toObject(value) {
|
|
return isObject(value) ? value : Object(value);
|
|
}
|
|
|
|
export default toObject;
|