Typetypesv0.13.0StringEndsWithFilters string union types to only include those that end with a specific string type StringEndsWith< BaseUnion extends string, EndingString extends string > = BaseUnion extends `${string}${EndingString}` ? BaseUnion : never;ExamplesCopytype Example = 'apple' | 'banana' | 'apricot' | 'cherry' | 'strawberry'; type Result = EndsWith<Example, 'rry'>; // Result: 'cherry' | 'strawberry'Type parametersBaseUnionThe union of strings to filter BaseUnion extends stringEndingStringThe string that valid members must end with EndingString extends string