mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
16 lines
331 B
JavaScript
16 lines
331 B
JavaScript
define(['../lang/isObject'], function(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);
|
|
}
|
|
|
|
return toObject;
|
|
});
|