findValueForKey
Stentor API Reference / stentor-utils/src / findValueForKey
Function: findValueForKey()
findValueForKey\<
V>(key,obj):V
Defined in: packages/stentor-utils/src/object/findValueForKey.ts:17
Searches the provided object for the provided key.
Smarter than a normal obj[key] as key can also be a regex.
In the cases where a regex is broad (".*") but there is also an exact match, the exact match is preferred.
Type Parametersβ
Vβ
V
Parametersβ
keyβ
string
objβ
ObjectWithKeys\<V>
Returnsβ
V