Last active
March 16, 2022 13:24
-
-
Save HatemSat/af7cfc23081a6508b72037cbfaf41641 to your computer and use it in GitHub Desktop.
ts-types
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
// Deeply anyfy nested Date and string properties : | |
type Any<T> = { | |
[Key in keyof T]: T[Key] extends { [K: string]: any } ? (T[Key] extends Date | string ? any : Any<T[Key]>) : any; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment