UNPKG

echadospalante-core

Version:

This package contains the core of the echadospalante project, it contains the domain entities, helpers, and other utilities that are shared between the different services.

25 lines (19 loc) 574 B
type BasicProperties<T> = { [K in keyof T]: T[K] extends boolean | number | string | Date ? T[K] : never; }; type ComplexProperties<T> = { [K in keyof T]: T[K] extends object | any[] ? T[K] extends Date ? never : T[K] : never; }; type NonNever<T> = { [K in keyof T as T[K] extends never ? never : K]: T[K]; }; export type BasicType<T> = NonNever<BasicProperties<T>>; export type ComplexType<T> = NonNever<ComplexProperties<T>>; type Booleanized<T> = { [K in keyof T]: boolean; }; export type ComplexInclude<T> = Booleanized<ComplexType<T>>;