@foxpage/foxpage-core
Version:
foxpage core
20 lines (19 loc) • 510 B
TypeScript
/**
*
* {{AA:BB:CC}} => AA -> BB -> CC
* {{AA['BB:CC']['DD']}} => AA -> 'BB:CC' -> 'DD'
* @param expressionStr
* @returns
*/
export declare function getPath(expressionStr: string): (string | string[])[];
/**
* get value with scope
*
* @export
* @template T
* @param {Record<string, any>} scope
* @param {string} expression
* @return {*} {T}
*/
export declare function getValue<T = unknown>(scope: Record<string, any>, expression: string): T;
export declare const evalWithScope: typeof getValue;