Skip to content

Commit

Permalink
fix: generic tag queries not accepting uppercase letters
Browse files Browse the repository at this point in the history
  • Loading branch information
cameri committed May 19, 2023
1 parent 054b110 commit 149d611
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/filter.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const isGenericTagQuery = (key: string) => /^#[a-z]$/.test(key)
export const isGenericTagQuery = (key: string) => /^#[a-zA-Z]$/.test(key)
21 changes: 21 additions & 0 deletions test/unit/utils/filter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { expect } from 'chai'

import { isGenericTagQuery } from '../../../src/utils/filter'

describe('isGenericTagQuery', () => {
it('returns true for #a', () => {
expect(isGenericTagQuery('#a')).to.be.true
})

it('returns true for #A', () => {
expect(isGenericTagQuery('#A')).to.be.true
})

it('returns false for #0', () => {
expect(isGenericTagQuery('#0')).to.be.false
})

it('returns false for #abc', () => {
expect(isGenericTagQuery('#abc')).to.be.false
})
})

0 comments on commit 149d611

Please sign in to comment.