File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
- const transform = ( replacement : string ) => ( transformations : Array < string > ) => (
2
- ...config : Array < string >
3
- ) => {
1
+ const transform = ( replacement : string ) => (
2
+ transformations : Array <
3
+ "toUpperCase" | "toLowerCase" | "trim" | "trimLeft" | "trimRight"
4
+ > ,
5
+ ) => ( ...config : Array < string > ) => {
4
6
const [ offset , string ] = config . slice ( - 2 ) ;
5
7
6
8
const matches = config . slice ( 0 , - 2 ) ;
7
9
8
10
const transformedMatches = transformations . map ( ( transformation , i ) =>
9
- matches [ i ] [ transformation ] ( )
11
+ matches [ i ] [ transformation ] ( ) ,
10
12
) ;
11
13
12
14
const allMatches = transformedMatches . concat (
13
- matches . slice ( transformedMatches . length )
15
+ matches . slice ( transformedMatches . length ) ,
14
16
) ;
15
17
16
18
return replacement
You can’t perform that action at this time.
0 commit comments