• Get a value at a path in an object.

    Type Parameters

    • T = unknown

    Parameters

    • obj: Record<string, unknown>

      The object to get the value from.

    • path: string

      The path to get the value from.

    • Optionaloptions: GetAtPathOptions

      The options for getting the value.

    Returns T | undefined

    The value at the path, or undefined if not found.

    const obj = { a: { b: { c: 1 } } };
    const value = getAtPath(obj, "a.b.c");
    console.log(value); // 1