UNPKG

512 BTypeScriptView Raw
1/**
2 * 获取对象的属性的值,如果值为 undefined,则返回默认值
3 * @param obj 对象
4 * @param property 键、路径
5 * @param defaultValue 默认值
6 */
7export declare function get<T extends object, K extends keyof T>(obj: T, property: string | string[], defaultValue?: any): T[K];
8export declare function get(obj: any, property: string | string[], defaultValue?: any): any;
9
10declare module './ctor' {
11 interface XEUtilsMethods {
12 get: typeof get;
13 }
14}
15
16export default get