import heroTheme from '../themes/hero'; import legacyTheme from '../themes/legacy'; // https://stackoverflow.com/questions/53807517/how-to-test-if-two-types-are-exactly-the-same /** * Tests if two types are equal */ type IfEquals = (() => G extends T ? 1 : 2) extends () => G extends U ? 1 : 2 ? Y : N; /*eslint-disable-next-line */ let exactType: ((draft: T & IfEquals, expected: U & IfEquals) => IfEquals) | undefined; if (exactType) { //if Hero_Theme is not match to Legacy_Theme, the compile shows error exactType(heroTheme, legacyTheme); // error }