Returns the dot delimited path of a given object by the given key-value pair. Example:
const obj = {
level: 'first',
nested: {
level: 'second'
}
};
const key = 'level';
const value = 'second';
ObjectUtil.getPathByKeyValue(obj, key, value); // 'nested.level'
Note: It will return the first available match!
The object to obtain the path from.
The key to look for.
The value to look for.
Method may be used to return a value of a given input object by a provided query key. The query key can be used in two ways:
The key to be searched.
The object to be searched on
The target value or undefined
if the given couldn't be
found, or an object if a path was passed, from which we only could
find a part, but not the most specific one.
TODO Harmonize return values
Generated using TypeDoc
This class provides some static methods which might be helpful when working with objects.