lodash-es
Version:
The modern build of lodash exported as ES modules.
15 lines (12 loc) • 303 B
JavaScript
import isObject from '../lang/isObject';
/**
* Converts `value` to an object if it's 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;