diff --git a/packages/base/core/src/types/Selector.ts b/packages/base/core/src/types/Selector.ts index 96b943ba6..eca24a3e4 100644 --- a/packages/base/core/src/types/Selector.ts +++ b/packages/base/core/src/types/Selector.ts @@ -33,7 +33,7 @@ export interface FieldExpression { } // Recursive type to generate dot-notation keys -type DotNotation = { +export type DotNotation = { [K in keyof T & string]: T[K] extends Array // If it's an array, include both the index and the $ wildcard ? `${K}` | `${K}.$` | `${K}.${DotNotation}` @@ -43,7 +43,7 @@ type DotNotation = { : `${K}` // Base case: Just return the key }[keyof T & string] -type GetType = +export type GetType = P extends `${infer H}.${infer R}` ? H extends keyof T ? T[H] extends Array