Hosanna UI API v2.3.0-next
    Preparing search index...

    Function getValueByPath

    • Retrieves a value from a nested object or array using a dot-separated path string. Supports array indexing and concatenated keys for complex structures.

      Type Parameters

      • T = unknown

        The expected return type.

      Parameters

      • content: unknown

        The object or array to traverse.

      • path: string

        Dot-separated string representing the path to the desired value.

      • defaultValue: unknown = undefined

        Value to return if the path does not exist.

      Returns T

      The value at the specified path, or the default value if not found.