exporttypePartialBy<T,KextendskeyofT>=Omit<T,K>&Partial<Pick<T,K>>;exporttypeMaybeNull<T>=T|null;exporttypeMaybeUndefined<T>=T|undefined;exporttypeMaybeNil<T>=T|null|undefined;exporttypeAsyncFn=(...args:any[])=>Promise<any>;exporttypeAnyFn=(...args:any[])=>any;exporttypeUnboxPromise<TextendsPromise<any>>=TextendsPromise<inferU>?U:never;exporttypeNullable<T>={[PinkeyofT]:MaybeNull<T[P]>;};exporttypeNullableBy<T,KextendskeyofT>=Omit<T,K>&Nullable<Pick<T,K>>;exporttypeDistributedArray<U>=Uextendsany?U[]:never;/**
* type ID = string | number;
* type T0 = ID[];
* type T1 = DistributedArray<ID>;
* type EQ1 = IfEquals<T0, T1, 'same', 'different'>; // different
*/exporttypeIfEquals<T,U,Y=unknown,N=never>=(<G>()=>GextendsT?1:2)extends<G>()=>GextendsU?1:2?Y:N;exporttypeOptional<T,KextendskeyofT>=Pick<Partial<T>,K>&Omit<T,K>;exporttypeValueOf<T>=T[keyofT];
Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
utils/ts-utility-types.ts
:C'mon show us some functions 🤣🤣
I'm not sure about those TypeDefs honestly, I think it's better to have an inline, let's say:
so it's more clear for everyone than saying
but to keep the honesty in this comment, this is opinionated and I may be wrong 😅