1 var copyObject = require('./internal/copyObject'),
2 keysIn = require('./keysIn');
5 * Converts `value` to a plain object flattening inherited enumerable
6 * properties of `value` to own properties of the plain object.
11 * @param {*} value The value to convert.
12 * @returns {Object} Returns the converted plain object.
19 * Foo.prototype.c = 3;
21 * _.assign({ 'a': 1 }, new Foo);
22 * // => { 'a': 1, 'b': 2 }
24 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
25 * // => { 'a': 1, 'b': 2, 'c': 3 }
27 function toPlainObject(value) {
28 return copyObject(value, keysIn(value));
31 module.exports = toPlainObject;