Created
September 13, 2019 06:07
-
-
Save dacioromero/727d321949faf313e0108c736cc4e52d to your computer and use it in GitHub Desktop.
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 KeysMatchingValue<T, V> = { [P in keyof T]: T[P] extends V ? P : never }[keyof T] | |
type PickByValue<T, V> = Pick<T, KeysMatchingValue<T, V>> | |
type OmitByValue<T, V> = Omit<T, KeysMatchingValue<T, V>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment