xtablo-source/xtablo-expo/types/removeNull.ts
2025-07-17 23:10:55 +02:00

11 lines
314 B
TypeScript

/**
* Utility type to remove null from a type
*/
export type RemoveNull<T> = T extends null ? never : T;
/**
* Utility type to remove null from all properties of an object type
*/
export type RemoveNullFromObject<T, K extends keyof T = keyof T> = {
[L in keyof T]: L extends K ? RemoveNull<T[L]> : T[L];
};