function searchInObject(obj, property) {
    if (property === '') {
        return obj;
    }
    try {
        let value = property.split('.')[0];
        let nextValue = property.split('.').slice(1).join('.');
        if (obj[value]) {
            return searchInObject(obj[value], nextValue);
        } else if (obj.value && obj.value[value]) {
            return searchInObject(obj.value[value], nextValue);
        } else {
            return null;
        }
    } catch (err) {
        return null;
    }
}
Search a variable value in an object.
@param {object} obj
@param {string} property
@returns