This file contains hidden or 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 Equals<A, B> = | |
(<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) | |
? true | |
: false; | |
type ReadOnlyObj<T, K extends keyof T> = { | |
readonly [P in K]: T[K] | |
} |