You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* type Example1 = DeepStrictObjectKeys<{ a: { b: 1; c: 2 }}>; // "a" | "a.b" | "a.c"
72
72
* type Example2 = DeepStrictObjectKeys<{ a: { b: 1; c: { d: number }[] }}>; // "a" | "a.b" | "a.c" | "a.c[*].d"
73
73
* ```
74
-
* @template Target Destination type for which you want to pull a key
75
-
* @template Joiner It means what symbol to connect when recursively spinning superimposed types.
76
-
* @template IsSafe When a key is a combination type of a primitive type and an object, it means whether to perform a recursive search or not.
74
+
* @template Target - The object type to extract nested keys from
75
+
* @template Joiner - Defines the separator symbols for joining nested paths. `array` is used for array access (default `'[*]'`), `object` is used for object access (default `'.'`).
76
+
* @template IsSafe - When `true`, stops at union types that mix primitives and objects without recursing into them. When `false`, recursively explores all branches of such union types.
77
+
* @returns A union of all dot-notation key paths in `Target`
* - For arrays, it appends array indices (`[*]`) followed by the key of the element.
43
53
* - For objects, it recursively traverses the nested structure and appends the last level keys.
44
54
*
45
-
* Example Usage:
55
+
* @template T - The object type to extract leaf keys from
56
+
* @template Joiner - Defines the separator symbols for joining nested paths. `array` is used for array access (default `'[*]'`), `object` is used for object access (default `'.'`).
57
+
* @template P - The property keys of `T` to iterate over (defaults to `keyof T`)
58
+
* @returns A union of dot-notation strings representing only the deepest (leaf) keys in `T`
0 commit comments