mirror of
https://github.com/Cameri/nostream.git
synced 2025-06-19 13:10:48 +02:00
fix: generic tag queries not accepting uppercase letters (#312)
This commit is contained in:
parent
430958f116
commit
7331f9560f
@ -1 +1 @@
|
|||||||
export const isGenericTagQuery = (key: string) => /^#[a-z]$/.test(key)
|
export const isGenericTagQuery = (key: string) => /^#[a-zA-Z]$/.test(key)
|
||||||
|
21
test/unit/utils/filter.ts
Normal file
21
test/unit/utils/filter.ts
Normal file
@ -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
|
||||||
|
})
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user