Prechádzať zdrojové kódy

feat(home): 종목 차트 심볼 매핑에 Yahoo 미국주 티커 지원

- tvSymbolForQuote: (구) Stooq .us 하위호환 + Yahoo 순수 티커(AAPL) → TradingView 동일 심볼
- 백엔드 수집 소스 Yahoo 전환에 맞춤

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
KIM-JINO5 2 týždňov pred
rodič
commit
341b007f04
1 zmenil súbory, kde vykonal 7 pridanie a 3 odobranie
  1. 7 3
      types/marketQuote.ts

+ 7 - 3
types/marketQuote.ts

@@ -31,12 +31,16 @@ export function groupLabel(code: string): string {
 	return GROUP_LABELS[code] ?? code;
 	return GROUP_LABELS[code] ?? code;
 }
 }
 
 
-// Stooq 심볼 → TradingView 심볼(드릴다운). 미국주(.us)만 확정 매핑 — 그 외는 null(차트 버튼 미표시).
+// 심볼 → TradingView 심볼(드릴다운). 미국주만 확정 매핑 — 그 외는 null(차트 버튼 미표시).
+// Yahoo 미국주는 접미사 없는 순수 티커(AAPL)라 TradingView 동일 심볼. (구) Stooq 표기(aapl.us)도 하위호환.
 export function tvSymbolForQuote(symbol: string): string|null {
 export function tvSymbolForQuote(symbol: string): string|null {
-	const s = symbol.trim().toLowerCase();
-	if (s.endsWith('.us')) {
+	const s = symbol.trim();
+	if (/\.us$/i.test(s)) {
 		return s.slice(0, -3).toUpperCase();
 		return s.slice(0, -3).toUpperCase();
 	}
 	}
+	if (/^[A-Za-z]{1,6}$/.test(s)) {
+		return s.toUpperCase();
+	}
 	return null;
 	return null;
 }
 }