path-value
Version:
Property path-to-value resolver, in TypeScript
30 lines (29 loc) • 1.03 kB
TypeScript
import { IPathOptions, PathInput } from './types';
/**
* High-level path-to-value resolution function, to either return the resolved value or throw a detailed error.
*
* @param target
* Default resolution scope.
*
* @param path
* Resolution path, either as an array of property names, or a dot-separated string.
* If the path starts with `this`, resolution is against the calling context.
*
* @param options
* Path-parsing options.
*/
export declare function resolveValue(this: any, target: any, path: PathInput, options?: IPathOptions): any;
/**
* Extends validation for missing last property, to throw a detailed error.
*
* @param target
* Default resolution scope.
*
* @param path
* Resolution path, either as an array of property names, or a dot-separated string.
* If the path starts with `this`, resolution is against the calling context.
*
* @param options
* Path-parsing options.
*/
export declare function resolveIfExists(this: any, target: any, path: PathInput, options?: IPathOptions): any;