Last active
April 2, 2022 11:37
-
-
Save MohammedEssehemy/65d327bb98ee5f0c3abcd359368a444f to your computer and use it in GitHub Desktop.
typescript utils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type ClassType<T> = new () => T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type PrimitiveType = string | number | boolean | null | undefined | never | Function; | |
export type ConvertDateToString<T> = | |
T extends Date ? string : | |
T extends PrimitiveType ? T : | |
T extends Array<infer U> ? Array<ConvertDateToString<U>> : | |
{ [K in keyof T]: ConvertDateToString<T[K]> }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment