Options
All
  • Public
  • Public/Protected
  • All
Menu

Module toPlainObject

Index

References

Functions Lang

References

Renames and re-exports toPlainObject

Lang Functions

  • toPlainObject(value: any): {}
  • Converts value to a plain object flattening inherited enumerable string keyed properties of value to own properties of the plain object.

    since

    5.13.0

    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 }

    Parameters

    • value: any

      The value to convert.

    Returns {}

    Returns the converted plain object.