Skip to content

Commit 4284e31

Browse files
committed
refactor: - Reuse fieldRegex() for priorityRegex
1 parent 26c78ad commit 4284e31

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/TaskSerializer/DefaultTaskSerializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const DEFAULT_SYMBOLS: DefaultTaskSerializerSymbols = {
9595
// The following regex's end with `$` because they will be matched and
9696
// removed from the end until none are left.
9797
// \uFE0F? allows an optional Variant Selector 16 on emojis.
98-
priorityRegex: /([🔺🔼🔽])\uFE0F?$/u,
98+
priorityRegex: fieldRegex('([🔺⏫🔼🔽⏬])\uFE0F?$', ''),
9999
startDateRegex: dateFieldRegex('🛫'),
100100
createdDateRegex: dateFieldRegex('➕'),
101101
scheduledDateRegex: dateFieldRegex('[⏳⌛]'),

tests/TaskSerializer/DefaultTaskSerializer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('validate emoji regular expressions', () => {
6565
it('regular expressions should have expected source', () => {
6666
expect(generateRegexApprovalTest()).toMatchInlineSnapshot(`
6767
"
68-
priorityRegex: /([🔺⏫🔼🔽⏬])\\uFE0F?$/u
68+
priorityRegex: /([🔺⏫🔼🔽⏬])\\ufe0f?$/u
6969
startDateRegex: /🛫 *(\\d{4}-\\d{2}-\\d{2})$/u
7070
createdDateRegex: /➕ *(\\d{4}-\\d{2}-\\d{2})$/u
7171
scheduledDateRegex: /[⏳⌛] *(\\d{4}-\\d{2}-\\d{2})$/u

0 commit comments

Comments
 (0)