File tree 2 files changed +3
-4
lines changed
2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ const rawCliOptions: OddlyCasedProperties<SomeOptions> = {
88
88
@category Change case
89
89
@category Template literal
90
90
*/
91
- export type DelimiterCase < Value , Delimiter extends string > = Value extends string
91
+ export type DelimiterCase < Value , Delimiter extends string > = string extends Value ? Value : Value extends string
92
92
? StringArrayToDelimiterCase <
93
93
SplitIncludingDelimiters < Value , WordSeparators | UpperCaseCharacters > ,
94
94
true ,
Original file line number Diff line number Diff line change @@ -48,9 +48,8 @@ expectType<'##very#prefixed'>(delimiterFromDoublePrefixedKebab);
48
48
const delimiterFromRepeatedSeparators : DelimiterCase < 'foo____bar' , '#' > = 'foo####bar' ;
49
49
expectType < 'foo####bar' > ( delimiterFromRepeatedSeparators ) ;
50
50
51
- // TODO: Fails after TS 4.8.
52
- // const delimiterFromString: DelimiterCase<string, '#'> = 'foobar';
53
- // expectType<string>(delimiterFromString);
51
+ const delimiterFromString : DelimiterCase < string , '#' > = 'foobar' ;
52
+ expectType < string > ( delimiterFromString ) ;
54
53
55
54
const delimiterFromScreamingSnake : DelimiterCase < 'FOO_BAR' , '#' > = 'foo#bar' ;
56
55
expectType < 'foo#bar' > ( delimiterFromScreamingSnake ) ;
You can’t perform that action at this time.
0 commit comments