Function flattenObjectPrivate

  • Private

    Receives a tree-like object and returns a plain object which depth is 1.

    • Input:

    { name: 'John', address: { street: 'Fake St. 123', coordinates: { longitude: 55.6779627, latitude: 12.5964313 } } }

    • Output:

    { name: 'John', address.street: 'Fake St. 123', address.coordinates.latitude: 55.6779627, address.coordinates.longitude: 12.5964313 }

    Type Parameters

    • T extends {}

    Parameters

    • value: T

      an Object

    Returns T extends object
        ? Flatten<T>
        : T

    a flattened object