| var copyObject = require('./_copyObject'), |
| keysIn = require('./keysIn'); |
| * Converts `value` to a plain object flattening inherited enumerable string |
| * keyed properties of `value` to own properties of the plain object. |
| * @param {*} value The value to convert. |
| * @returns {Object} Returns the converted plain object. |
| * _.assign({ 'a': 1 }, new Foo); |
| * // => { 'a': 1, 'b': 2 } |
| * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); |
| * // => { 'a': 1, 'b': 2, 'c': 3 } |
| function toPlainObject(value) { |
| return copyObject(value, keysIn(value)); |
| module.exports = toPlainObject; |