Files
lodash/internal/toObject.js
John-David Dalton f9606b394c Bump to v3.0.0.
2015-02-04 00:38:56 -08:00

15 lines
309 B
JavaScript

var isObject = require('../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);
}
module.exports = toObject;