@@ -96,7 +96,7 @@ type PathInternalArray<TValue extends ReadonlyArray<any>, TraversedTypes> =
96
96
*/
97
97
type PathInternalObject < TValue , TraversedTypes , First extends boolean > = {
98
98
[ Key in keyof TValue & string ] : First extends true
99
- ? '' | `${Key } ` | `${Key } ${PathInternal < TValue [ Key ] , TraversedTypes , false > } `
99
+ ? `${Key } ` | `${Key } ${PathInternal < TValue [ Key ] , TraversedTypes , false > } `
100
100
: `.${Key } ` | `.${Key } ${PathInternal < TValue [ Key ] , TraversedTypes , false > } `;
101
101
} [ keyof TValue & string ] ;
102
102
@@ -105,11 +105,7 @@ type PathInternalObject<TValue, TraversedTypes, First extends boolean> = {
105
105
*
106
106
* See {@link Path}
107
107
*/
108
- type PathInternalAny < First extends boolean > =
109
- | ( First extends true ? '' : never )
110
- | `.${string } `
111
- | `[${string } ]`
112
- | `[${string } ].${string } `;
108
+ type PathInternalAny = `.${string } ` | `[${string } ]` | `[${string } ].${string } `;
113
109
114
110
/**
115
111
* Helper type for recursively constructing paths through a type.
@@ -120,7 +116,7 @@ type PathInternalAny<First extends boolean> =
120
116
*/
121
117
type PathInternal < TValue , TraversedTypes , First extends boolean > = TValue extends Primitive | BrowserNativeObject
122
118
? IsAny < TValue > extends true
123
- ? PathInternalAny < First >
119
+ ? PathInternalAny
124
120
: never
125
121
: TValue extends ReadonlyArray < any >
126
122
? // Check so that we don't recurse into the same type by ensuring that the
0 commit comments