Utilities
getPathValue
Takes in an object and a key and returns the value of the key.
Params
Signature: getPathValue(obj, key)
obj
: The object to get the value from
key
: The key to get the value from (supports dot notation)
Returns
Returns the value of the key.
Examples
import { getPathValue } from '@adobe-commerce/elsie/lib';
const obj = { foo: { bar: 'baz', },};
const result = getPathValue(obj, 'foo.bar');
console.log(result); // "baz"