getAtPath
functionsignature
getAtPath(obj, dottedPath): anyWalks a dotted path (e.g., "counter.value") into an object.
Parameters
| Name | Type | Description |
|---|---|---|
obj | any | Root object to traverse. |
| Name | Type | Description |
|---|---|---|
dottedPath | string | Dot-separated path string. |
Returns
any, The value at the path, or undefined if unreachable.
Example
example
import { getAtPath } from "@yoltra/devtools-protocol";
const state = { counter: { value: 10 } };
getAtPath(state, "counter.value"); // 10
getAtPath(state, "missing.key"); // undefined