• 通过object路径获取值

    Example

    getObjValueByPath({a: {b: {c: 123}}}, "a.b.c") // => 123
    

    Type Parameters

    • T extends Record<string, any>

    • P extends string

    • S extends string = ""

    Parameters

    • obj: T
    • path: TransferPathOf<T, P, S, DotTrim<RemoveStrStart<P, S>>, TransferPath<DotTrim<RemoveStrStart<P, S>>, DotTrim<DotTrim<RemoveStrStart<P, S>>>>, PathOf<T, TransferPath<DotTrim<RemoveStrStart<P, S>>, DotTrim<DotTrim<RemoveStrStart<P, S>>>>, "">>
    • Optional objName: S = ...

    Returns TypeOfPath<T, TransferPath<DotTrim<RemoveStrStart<P, S>>>>