toObject.js 303 B

1234567891011121314
  1. import isObject from '../lang/isObject';
  2. /**
  3. * Converts `value` to an object if it's not one.
  4. *
  5. * @private
  6. * @param {*} value The value to process.
  7. * @returns {Object} Returns the object.
  8. */
  9. function toObject(value) {
  10. return isObject(value) ? value : Object(value);
  11. }
  12. export default toObject;