Merge pull request #315 from Hexastack/314-bug-tfilterquery-type-infer-all-the-date-functions

fix(api): exclude functions as nested types
This commit is contained in:
Med Marrouchi 2024-11-04 16:37:06 +01:00 committed by GitHub
commit 81a507d091
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,11 +16,14 @@ export type TFilterKeysOfNeverType<T> = Omit<T, TFilterKeysOfType<T, []>>;
export type NestedKeys<T> = T extends object
? {
[K in keyof T]: Array<any> extends T[K]
? Exclude<K, symbol>
: K extends symbol
// eslint-disable-next-line @typescript-eslint/ban-types
[K in keyof T]: T[K] extends Function
? never
: Array<any> extends T[K]
? Exclude<K, symbol>
: `${Exclude<K, symbol>}${'' | `.${NestedKeys<T[K]>}`}`;
: K extends symbol
? Exclude<K, symbol>
: `${Exclude<K, symbol>}${'' | `.${NestedKeys<T[K]>}`}`;
}[keyof T]
: never;