Skip to content

Commit 7331f95

Browse files
authored
fix: generic tag queries not accepting uppercase letters (#312)
1 parent 430958f commit 7331f95

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/utils/filter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const isGenericTagQuery = (key: string) => /^#[a-z]$/.test(key)
1+
export const isGenericTagQuery = (key: string) => /^#[a-zA-Z]$/.test(key)

test/unit/utils/filter.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { expect } from 'chai'
2+
3+
import { isGenericTagQuery } from '../../../src/utils/filter'
4+
5+
describe('isGenericTagQuery', () => {
6+
it('returns true for #a', () => {
7+
expect(isGenericTagQuery('#a')).to.be.true
8+
})
9+
10+
it('returns true for #A', () => {
11+
expect(isGenericTagQuery('#A')).to.be.true
12+
})
13+
14+
it('returns false for #0', () => {
15+
expect(isGenericTagQuery('#0')).to.be.false
16+
})
17+
18+
it('returns false for #abc', () => {
19+
expect(isGenericTagQuery('#abc')).to.be.false
20+
})
21+
})

0 commit comments

Comments
 (0)