File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 63
63
</ select >
64
64
</ div >
65
65
66
+ < div class ="checkbox ">
67
+ < label >
68
+ < input type ="checkbox " checked ="checked " class ="form-check-input js-case ">
69
+ Case-sensitive
70
+ </ label >
71
+ </ div >
72
+
66
73
< div class ="checkbox ">
67
74
< label >
68
75
< input type ="checkbox " checked ="checked " class ="form-check-input js-trim ">
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const { Preserve, TrimLeadingAndTrailing } = WhitespaceHandling;
6
6
7
7
const $input = document . querySelector < HTMLTextAreaElement > ( '.js-words' ) ;
8
8
const $delimiter = document . querySelector < HTMLSelectElement > ( '.js-delimiter' ) ;
9
+ const $caseSensitive = document . querySelector < HTMLInputElement > ( '.js-case' ) ;
9
10
const $trim = document . querySelector < HTMLInputElement > ( '.js-trim' ) ;
10
11
const $output = document . querySelector < HTMLTextAreaElement > ( '.js-output' ) ;
11
12
@@ -26,10 +27,15 @@ function displayPattern(pattern: string) {
26
27
}
27
28
28
29
function onClickGenerate ( ) {
29
- const words = $input . value ;
30
+ let words = $input . value ;
30
31
const delimiter = $delimiter . selectedOptions [ 0 ] . value ;
32
+ const isCaseSensitive = $caseSensitive . checked ;
31
33
const isWhitespaceTrimmed = $trim . checked ;
32
34
35
+ if ( ! isCaseSensitive ) {
36
+ words = words . toLowerCase ( ) ;
37
+ }
38
+
33
39
const whitespace = isWhitespaceTrimmed ? TrimLeadingAndTrailing : Preserve ;
34
40
35
41
const pattern = generatePattern ( words , delimiter , whitespace ) ;
You can’t perform that action at this time.
0 commit comments