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:
Luke De Feo
2022-06-07 04:29:16 -07:00
committed by Facebook GitHub Bot
parent 3412ddfb1b
commit 48bebdc665

View File

@@ -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) {