Function getNestedValue

  • Get nested value from the given object.

    Parameters

    • d: AnyObject = {}

      The object from which the nested value will be retrieved.

    • k: string = ""

      The dot-separated key to access the nested value.

    Returns any

    • The nested value from the given object. If the nested value is not found, null is returned.

    Example

    const data = {
    pid: 'some-id',
    portions: {
    name: 'section'
    }
    };
    console.log(getNestedValue(data, "portions.name")); // 'section'

Generated using TypeDoc