Improve typing of getValueAtPath
Summary: Context: https://www.internalfb.com/diff/D36663929 (e07d5c5bfe)?dst_version_fbid=701770760940095&transaction_fbid=714786499947486
Reviewed By: antonk52
Differential Revision: D36782095
fbshipit-source-id: 2eb29d70aa641d386b129bf957320b718e97c298
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3412ddfb1b
commit
48bebdc665
@@ -555,7 +555,8 @@ function computeInitialColumns(
|
||||
* @param keyPath dotted string path, e.g foo.bar
|
||||
* @returns value at the key path
|
||||
*/
|
||||
export function getValueAtPath(obj: any, keyPath: string): any {
|
||||
|
||||
export function getValueAtPath(obj: Record<string, any>, keyPath: string): any {
|
||||
let res = obj;
|
||||
for (const key of keyPath.split('.')) {
|
||||
if (res == null) {
|
||||
|
||||
Reference in New Issue
Block a user