vtils

Home > types > Path

Path type

获取对象的路径。最多支持 7 级路径。

Signature:

export declare type Path<T, L> = PathArray<T, L> | keyof T;

Example

function get<T, L extends Path<T, L>>(
  object: T,
  path: L,
): PathValue<T, L> {
  // ...
}