Function DeepGet
Parameters
- obj: { [key: string]: any }
The object from which the value is to be retrieved.
- key: string
The key in dot notation representing the path to the value.
Optional
options: { sep: string }Optional settings.
sep: string
Custom key separator (default:
'.'
).
Returns any
The value at the specified key if it exists, or
undefined
if the key is not found or an error occurs.- obj: { [key: string]: any }
Retrieves a value from a nested object using a dot notation key.
This function will never throws any error if there is a problem with the input type. It will return
undefined
instead. This also means that if the key is not found, the function will returnundefined
instead ofnull
especially when working on JSON data.