• Returns the target value in a nested JSON object, based on the given key

    Example

    const data = {
    level1: {
    level2: {
    level3: 'some data'
    }
    }
    };
    dig(data, 'level3'); // 'some data'
    dig(data, 'level4'); // undefined

    Parameters

    • obj: Record<string, unknown>
    • target: string

    Returns unknown

Generated using TypeDoc