Kitto
    Preparing search index...

    Module find_object

    2.0.0

    Finds an object in an array that contains a specific key-value pair.

    The array of objects to search through

    The key to match in the objects

    The value associated with the key to match

    If true, the function will search recursively through nested objects and arrays

    The object that matches the key-value pair, or undefined if no match is found

    // Example usage:
    const data = [
    {
    id: 1,
    name: 'John',
    children: [
    {
    id: 2,
    name: 'Jane',
    details: { key: 'info', value: 'targetValue' }
    },
    {
    id: 3,
    name: 'Joe'
    }
    ]
    }
    ];

    const result = find_object(data, 'value', 'targetValue', true);
    console.log(result); // { key: 'info', value: 'targetValue' }

    Functions

    find_object