260916_01_ENH: SID 검색 시 문자 SID 허용 (틸드 범위는 숫자만 유지)

This commit is contained in:
2026-09-16 15:15:30 +09:00
parent b543d66186
commit 2464f6b443

View File

@@ -83,7 +83,7 @@ const deduplicateSidInput = (value: string) => [...new Set(toSidSet(value))].joi
const sanitizeSidInput = (value: string) => {
let result = ''
let lastChar: 'digit' | 'comma' | 'tilde' | null = null
let lastChar: 'digit' | 'char' | 'comma' | 'tilde' | null = null
let segmentHasTilde = false
for (const ch of value) {
@@ -93,7 +93,15 @@ const sanitizeSidInput = (value: string) => {
continue
}
if (ch === ',' && lastChar === 'digit') {
if (/[a-zA-Z_-]/.test(ch)) {
// 틸드 범위 검색은 숫자끼리만 허용되므로, 틸드 바로 뒤에는 문자를 붙이지 않는다.
if (lastChar === 'tilde') continue
result += ch
lastChar = 'char'
continue
}
if (ch === ',' && (lastChar === 'digit' || lastChar === 'char')) {
result += ch
lastChar = 'comma'
segmentHasTilde = false