From 2781abbc567fb0b1940f9b89369b70602293e5be Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Sun, 3 Nov 2024 12:48:02 +0100 Subject: [PATCH] fix(api): exclude functions as nested types --- api/src/utils/types/filter.types.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/src/utils/types/filter.types.ts b/api/src/utils/types/filter.types.ts index ef32456..27003ba 100644 --- a/api/src/utils/types/filter.types.ts +++ b/api/src/utils/types/filter.types.ts @@ -16,11 +16,14 @@ export type TFilterKeysOfNeverType = Omit>; export type NestedKeys = T extends object ? { - [K in keyof T]: Array extends T[K] - ? Exclude - : K extends symbol + // eslint-disable-next-line @typescript-eslint/ban-types + [K in keyof T]: T[K] extends Function + ? never + : Array extends T[K] ? Exclude - : `${Exclude}${'' | `.${NestedKeys}`}`; + : K extends symbol + ? Exclude + : `${Exclude}${'' | `.${NestedKeys}`}`; }[keyof T] : never;