Skip to content

Instantly share code, notes, and snippets.

@HatemSat
Last active March 16, 2022 13:24
Show Gist options
  • Save HatemSat/af7cfc23081a6508b72037cbfaf41641 to your computer and use it in GitHub Desktop.
Save HatemSat/af7cfc23081a6508b72037cbfaf41641 to your computer and use it in GitHub Desktop.
ts-types
// 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