Skip to content

Commit f866a3c

Browse files
committed
refactor: - lower-case the input string
1 parent bff686d commit f866a3c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/PriorityTools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class PriorityTools {
4949
* @see priorityNameUsingNormal
5050
*/
5151
public static priorityValue(priority: string): Priority {
52-
switch (priority) {
52+
switch (priority.toLowerCase()) {
5353
case 'lowest':
5454
return Priority.Lowest;
5555
case 'low':

tests/lib/PriorityTools.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ describe('priority naming', () => {
2626
['', Priority.None],
2727
['invalid_priority_string!', Priority.None],
2828

29-
// Priority string has to be in lower case
30-
['Highest', Priority.None],
31-
['highEst', Priority.None],
29+
// Priority string is lower-cased
30+
['Highest', Priority.Highest],
31+
['highEst', Priority.Highest],
3232
])('should get priority value "%s"', (str, value) => {
3333
expect(PriorityTools.priorityValue(str)).toEqual(value);
3434
});

0 commit comments

Comments
 (0)