Skip to main content

Function: resolvePath()

function resolvePath<T>(pathRootObject, path):
| {
resolved: true;
value: T;
}
| {
resolved: false;
value?: undefined;
};

Tries to resolve a path from an object.

Type Parameters​

Type ParameterDefault typeDescription
TanyReturned value type.

Parameters​

ParameterTypeDescription
pathRootObjectobjectObject that serves as path root.
pathPathPath as an string or number array.

Returns​

| { resolved: true; value: T; } | { resolved: false; value?: undefined; }

An object with { resolved: true, value: T } or { resolved: false }.