type IsString<T> = T extends string ? true : false; type A = IsString<"hello">; // true type B = IsString<42>; // false