getObjectFromDottedString
Function that, given a path, a value and an optional object, returns an object with as many properties as there are in the path, assigning the value passed to the last one specified. See demo
Types
GetObjectFromDottedStringProps
@templateT - The type of the value to set at the resolved path.@templateE - The object type to build or update.
Parameters accepted by getObjectFromDottedString.
| Property | Type | Required | Description |
|---|---|---|---|
path | string | ✓ | A dot-separated path string describing where to set the value within the object (e.g. "user.address.city"). Each segment corresponds to a nested property key. |
value | T | ✓ | The value to assign at the location described by path. |
object | E | An optional existing object to update. When provided, the value is set within a deep clone of this object. When omitted, a new object is built from scratch following the structure described by path. |
