Typetypesv0.12.0StringContainsFilters string union types to only include those that contain a specific substring type StringContains< BaseUnion extends string, Substring extends string > = BaseUnion extends `${string}${Substring}${string}` ? BaseUnion : never;ExamplesCopytype Example = 'apple' | 'banana' | 'apricot' | 'cherry' | 'strawberry'; type Result = Contains<Example, 'rr'>; // Result: 'cherry' | 'strawberry'Type parametersBaseUnionThe union of strings to filter BaseUnion extends stringSubstringThe substring that valid members must contain Substring extends string