custom-string-formatter
Version:
Customizable String Formatter
23 lines (22 loc) • 577 B
TypeScript
/**
* Result of calling function `resolveProperty` below,
* to indicate success+value for the property resolution.
*/
export interface IProperty {
/**
* Indicates if the property exists on the object.
*/
exists: boolean;
/**
* The resolved value, set only when 'exists' = true
*/
value?: any;
}
/**
* Parses a property and resolves its value from an object.
*
* It supports `this` as the first name to reference the object itself.
*/
export declare function resolveProperty(prop: string, obj: {
[key: string]: any;
}): IProperty;