Urara-Blog/node_modules/.pnpm-store/v3/files/7e/68853fcbf46ee271f1e1997258e212f5e4fd7e6c7cd881bcbb0ccab891d64bd55cffe6c32d9e95b4fe0a9a9a4abf9d3414539f84c98fa5bd38e7b1f3ee3c97
2022-08-14 01:14:53 +08:00

32 lines
744 B
Text

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.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {Object} Returns the converted plain object.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.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;