/** * Check if two types are assignable to each other. * For `Rhodium`, this means either * - `A extends (B | ..)` * - `B extends (A | ..)` */ export type isSameSoft = [A, B] extends [B, A] ? Yes : No; /** Check if two types are exactly the same. */ export type isSameHard = (() => T extends A ? 0 : 1) extends (() => T extends B ? 0 : 1) ? Yes : No; /** * Checks whether B is a subtype reduction of A: * mutually assignable, but not exactly same. */ export type doesReduceTo = isSameHard>; /** * Check whether {@linkcode Exclude Excluding} * type {@linkcode By} from type {@linkcode T} * cannot be reversed. */ export type isExcludeUnsafe = isSameHard>, By, No, // Inverted logic! Yes>;