mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-11 04:46:07 -08:00
refactor(main): eliminate local pass-through wrappers in main.ts (#168)
This commit is contained in:
1 parent
8711cf1a48
commit
2398f5c030
19 files changed
+706
-814
No files matched your search
@@ -60,9 +60,7 @@ export function tsukihimeTrackMatchesLanguages(
|
||||
export function describeTsukihimeTabLanguages(configuredLanguages: string[]): string {
|
||||
const normalized = [
|
||||
...new Set(
|
||||
configuredLanguages
|
||||
.map((candidate) => normalizeTsukihimeLangCode(candidate))
|
||||
.filter(Boolean),
|
||||
configuredLanguages.map((candidate) => normalizeTsukihimeLangCode(candidate)).filter(Boolean),
|
||||
),
|
||||
];
|
||||
if (normalized.length === 0) return 'English';
|
||||
|
||||
@@ -76,10 +76,7 @@ function asFiniteNumber(value: unknown): number | null {
|
||||
return typeof value === 'number' && Number.isFinite(value) ? value : null;
|
||||
}
|
||||
|
||||
export function mapTsukihimeSearchResults(
|
||||
payload: unknown,
|
||||
maxResults: number,
|
||||
): TsukihimeEntry[] {
|
||||
export function mapTsukihimeSearchResults(payload: unknown, maxResults: number): TsukihimeEntry[] {
|
||||
if (!isObject(payload) || !Array.isArray(payload.results)) return [];
|
||||
const entries: TsukihimeEntry[] = [];
|
||||
for (const item of payload.results) {
|
||||
|
||||
Reference in new issue
Block a user