Created
May 16, 2019 12:59
-
-
Save RoystonS/80f44cf2e50c8697322ac43e04cc26c0 to your computer and use it in GitHub Desktop.
looksLike typing
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 ComparisonPredicate<T> = (value: T) => boolean; | |
type ComparisonObject<T> = { [P in keyof T]?: ComparisonObject<T[P]> | ComparisonPredicate<T[P]> }; | |
function looksLike<T>(obj: T, comparison: ComparisonObject<T>): boolean { | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment